Class GuiElementCellList<T>
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementCellList<T> : GuiElement, IDisposable
Type Parameters
T
- Inheritance
-
GuiElementCellList<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementCellList(ICoreClientAPI, ElementBounds, OnRequireCell<T>, IEnumerable<T>)
Creates a new list in the current GUI.
public GuiElementCellList(ICoreClientAPI capi, ElementBounds bounds, OnRequireCell<T> cellCreator, IEnumerable<T> cells = null)
Parameters
capiICoreClientAPIThe Client API.
boundsElementBoundsThe bounds of the list.
cellCreatorOnRequireCell<T>The event fired when a cell is requested by the gui
cellsIEnumerable<T>The array of cells initialized with the list.
Fields
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
elementCells
The cells in the list. See IGuiElementCell for how it's supposed to function.
public List<IGuiElementCell> elementCells
Field Value
unscaledCellSpacing
the space between the cells. Default: 10
public int unscaledCellSpacing
Field Value
Properties
InsideClipBounds
If the element is inside a clip or not.
public override ElementBounds InsideClipBounds { get; set; }
Property Value
Methods
AddCell(T, int)
Adds a cell to the list.
protected void AddCell(T cell, int afterPosition = -1)
Parameters
cellTThe cell to add.
afterPositionintThe 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
ctxContextsurfaceImageSurfaceThe surface of the GUI.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
OnMouseDownOnElement(ICoreClientAPI, MouseEvent)
The event fired when the mouse is pressed while on the element. Called after OnMouseDown and tells the engine that the event is handled.
public override void OnMouseDownOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe Client API
argsMouseEventThe mouse event args.
OnMouseMove(ICoreClientAPI, MouseEvent)
The event fired when the mouse is moved.
public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe Client API.
argsMouseEventThe mouse event arguments.
OnMouseUpOnElement(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released on the element. Called after OnMouseUp.
public override void OnMouseUpOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe Client API
argsMouseEventThe mouse event args.
ReloadCells(IEnumerable<T>)
public void ReloadCells(IEnumerable<T> cells)
Parameters
cellsIEnumerable<T>
RemoveCell(int)
Removes a cell at a specified position.
protected void RemoveCell(int position)
Parameters
positionintThe position of the cell to remove.
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTimefloatThe change in time.