Table of Contents

Class GuiElementContainer

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public class GuiElementContainer : GuiElement, IDisposable
Inheritance
GuiElementContainer
Implements
Inherited Members

Constructors

GuiElementContainer(ICoreClientAPI, ElementBounds)

Creates a new list in the current GUI.

public GuiElementContainer(ICoreClientAPI capi, ElementBounds bounds)

Parameters

capi ICoreClientAPI

The Client API.

bounds ElementBounds

The bounds of the list.

Fields

Elements

The cells in the list. See IGuiElementCell for how it's supposed to function.

public List<GuiElement> Elements

Field Value

List<GuiElement>

UnscaledCellHorPadding

The padding on the horizontal axis of the cell. Default: 7

public int UnscaledCellHorPadding

Field Value

int

UnscaledCellVerPadding

The padding on the vertical axis of the cell. Default: 2

public int UnscaledCellVerPadding

Field Value

int

unscaledCellSpacing

the space between the cells. Default: 10

public int unscaledCellSpacing

Field Value

int

Methods

Add(GuiElement, int)

Adds a cell to the list.

public void Add(GuiElement elem, int afterPosition = -1)

Parameters

elem GuiElement

The cell to add.

afterPosition int

The position of the cell to add after. (Default: -1)

BeforeCalcBounds()

public override void BeforeCalcBounds()

CalcTotalHeight()

Calculates the total height for the list.

public void CalcTotalHeight()

ComposeElements(Context, ImageSurface)

Composes the elements.

public override void ComposeElements(Context ctx, ImageSurface surface)

Parameters

ctx Context
surface ImageSurface

The surface of the GUI.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

OnKeyDown(ICoreClientAPI, KeyEvent)

The event fired when a key is held down.

public override void OnKeyDown(ICoreClientAPI api, KeyEvent args)

Parameters

api ICoreClientAPI

The client API

args KeyEvent

The key event arguments.

OnKeyPress(ICoreClientAPI, KeyEvent)

The event fired the moment a key is pressed.

public override void OnKeyPress(ICoreClientAPI api, KeyEvent args)

Parameters

api ICoreClientAPI

The Client API.

args KeyEvent

The keyboard state when the key was pressed.

OnMouseDown(ICoreClientAPI, MouseEvent)

The event fired when the mouse is down the element is around. Fires before OnMouseDownOnElement, however OnMouseDownOnElement is called within the base function.

public override void OnMouseDown(ICoreClientAPI api, MouseEvent args)

Parameters

api ICoreClientAPI

The Client API

args MouseEvent

OnMouseMove(ICoreClientAPI, MouseEvent)

The event fired when the mouse is moved.

public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)

Parameters

api ICoreClientAPI

The Client API.

args MouseEvent

The mouse event arguments.

OnMouseUp(ICoreClientAPI, MouseEvent)

The event fired when the mouse is released.

public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)

Parameters

api ICoreClientAPI

The Client API.

args MouseEvent

The arguments for the mouse event.

OnMouseWheel(ICoreClientAPI, MouseWheelEventArgs)

The event fired when the mouse wheel is scrolled.

public override void OnMouseWheel(ICoreClientAPI api, MouseWheelEventArgs args)

Parameters

api ICoreClientAPI

The Client API

args MouseWheelEventArgs

The mouse wheel arguments.

RemoveCell(int)

Removes a cell at a specified position.

public void RemoveCell(int position)

Parameters

position int

The position of the cell to remove.

RenderInteractiveElements(float)

Renders the element as an interactive element.

public override void RenderInteractiveElements(float deltaTime)

Parameters

deltaTime float

The change in time.