Class GuiElementElementListPickerBase<T>
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Creates a toggle button for the GUI.
public abstract class GuiElementElementListPickerBase<T> : GuiElementControl, IDisposable
Type Parameters
T
- Inheritance
-
GuiElementElementListPickerBase<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
GuiElementElementListPickerBase(ICoreClientAPI, T, ElementBounds)
Constructor for the button
public GuiElementElementListPickerBase(ICoreClientAPI capi, T elem, ElementBounds bounds)
Parameters
capiICoreClientAPIThe core client API.
elemTboundsElementBoundsThe bounding box of the button.
Fields
On
Is this button on?
public bool On
Field Value
ShowToolTip
public bool ShowToolTip
Field Value
handler
public Action<bool> handler
Field Value
Properties
Focusable
Is this element capable of being in the focus?
public override bool Focusable { get; }
Property Value
TooltipText
public string TooltipText { set; }
Property Value
Methods
ComposeElements(Context, ImageSurface)
Composes the element in both the pressed, and released states.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctxContextThe context of the element.
surfaceImageSurfaceThe surface of the element.
Remarks
Neither the context, nor the surface is used in this function.
Dispose()
Disposes of the button.
public override void Dispose()
DrawElement(T, Context, ImageSurface)
public abstract void DrawElement(T elem, Context ctx, ImageSurface surface)
Parameters
elemTctxContextsurfaceImageSurface
OnMouseDownOnElement(ICoreClientAPI, MouseEvent)
Handles the mouse button press while the mouse is on this button.
public override void OnMouseDownOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe client API
argsMouseEventThe mouse event arguments.
OnMouseUp(ICoreClientAPI, MouseEvent)
Handles the event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe client API
argsMouseEventMouse event arguments
OnMouseUpOnElement(ICoreClientAPI, MouseEvent)
Handles the mouse button release while the mouse is on this button.
public override void OnMouseUpOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
apiICoreClientAPIThe client API
argsMouseEventThe mouse event arguments
RenderInteractiveElements(float)
Renders the button.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTimefloatThe time elapsed.
SetValue(bool)
Sets the value of the button.
public void SetValue(bool on)
Parameters
onboolAm I on or off?