Class GuiElementContainer
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementContainer : GuiElement, IDisposable
- Inheritance
-
GuiElementContainer
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementContainer(ICoreClientAPI, ElementBounds)
Creates a new list in the current GUI.
public GuiElementContainer(ICoreClientAPI capi, ElementBounds bounds)
Parameters
capi
ICoreClientAPIThe Client API.
bounds
ElementBoundsThe 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
UnscaledCellHorPadding
The padding on the horizontal axis of the cell. Default: 7
public int UnscaledCellHorPadding
Field Value
UnscaledCellVerPadding
The padding on the vertical axis of the cell. Default: 2
public int UnscaledCellVerPadding
Field Value
unscaledCellSpacing
the space between the cells. Default: 10
public int unscaledCellSpacing
Field Value
Methods
Add(GuiElement, int)
Adds a cell to the list.
public void Add(GuiElement elem, int afterPosition = -1)
Parameters
elem
GuiElementThe cell to add.
afterPosition
intThe 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()
Clear()
public void Clear()
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctx
Contextsurface
ImageSurfaceThe 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
ICoreClientAPIThe client API
args
KeyEventThe 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
ICoreClientAPIThe Client API.
args
KeyEventThe 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
ICoreClientAPIThe 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
ICoreClientAPIThe Client API.
args
MouseEventThe mouse event arguments.
OnMouseUp(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe 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
ICoreClientAPIThe Client API
args
MouseWheelEventArgsThe mouse wheel arguments.
RemoveCell(int)
Removes a cell at a specified position.
public void RemoveCell(int position)
Parameters
position
intThe position of the cell to remove.
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.