Class GuiElementCellList<T>
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementCellList<T> : GuiElement, IDisposableType 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
- capiICoreClientAPI
- The Client API. 
- boundsElementBounds
- The 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 UnscaledCellHorPaddingField Value
UnscaledCellVerPadding
The padding on the vertical axis of the cell. Default: 2
public int UnscaledCellVerPaddingField Value
elementCells
The cells in the list. See IGuiElementCell for how it's supposed to function.
public List<IGuiElementCell> elementCellsField Value
unscaledCellSpacing
the space between the cells. Default: 10
public int unscaledCellSpacingField 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
- cellT
- The cell to add. 
- afterPositionint
- 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
- ctxContext
- surfaceImageSurface
- The 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
- apiICoreClientAPI
- The Client API 
- argsMouseEvent
- The mouse event args. 
OnMouseMove(ICoreClientAPI, MouseEvent)
The event fired when the mouse is moved.
public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)Parameters
- apiICoreClientAPI
- The Client API. 
- argsMouseEvent
- The 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
- apiICoreClientAPI
- The Client API 
- argsMouseEvent
- The 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
- positionint
- The position of the cell to remove. 
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)Parameters
- deltaTimefloat
- The change in time.