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
capi
ICoreClientAPIThe Client API.
bounds
ElementBoundsThe bounds of the list.
cellCreator
OnRequireCell<T>The event fired when a cell is requested by the gui
cells
IEnumerable<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
cell
TThe 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()
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()
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
api
ICoreClientAPIThe Client API
args
MouseEventThe mouse event args.
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.
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
api
ICoreClientAPIThe Client API
args
MouseEventThe mouse event args.
ReloadCells(IEnumerable<T>)
public void ReloadCells(IEnumerable<T> cells)
Parameters
cells
IEnumerable<T>
RemoveCell(int)
Removes a cell at a specified position.
protected 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.