Table of Contents

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 ICoreClientAPI

The Client API.

bounds ElementBounds

The 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

int

UnscaledCellVerPadding

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

public int UnscaledCellVerPadding

Field Value

int

elementCells

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

public List<IGuiElementCell> elementCells

Field Value

List<IGuiElementCell>

unscaledCellSpacing

the space between the cells. Default: 10

public int unscaledCellSpacing

Field Value

int

Properties

InsideClipBounds

If the element is inside a clip or not.

public override ElementBounds InsideClipBounds { get; set; }

Property Value

ElementBounds

Methods

AddCell(T, int)

Adds a cell to the list.

protected void AddCell(T cell, int afterPosition = -1)

Parameters

cell T

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()

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 ICoreClientAPI

The Client API

args MouseEvent

The mouse event args.

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.

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 ICoreClientAPI

The Client API

args MouseEvent

The 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 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.