Class GuiElementCustomDraw
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementCustomDraw : GuiElement, IDisposable
- Inheritance
-
GuiElementCustomDraw
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementCustomDraw(ICoreClientAPI, ElementBounds, DrawDelegateWithBounds, bool)
Adds a custom drawing element to the GUI
public GuiElementCustomDraw(ICoreClientAPI capi, ElementBounds bounds, DrawDelegateWithBounds OnDraw, bool interactive = false)
Parameters
capi
ICoreClientAPIThe Client API
bounds
ElementBoundsThe bounds of the Element
OnDraw
DrawDelegateWithBoundsThe event fired when the object is drawn.
interactive
boolWhether or not the element is able to be interacted with (Default: false)
Methods
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctxStatic, ImageSurface surfaceStatic)
Parameters
ctxStatic
ContextThe context of the components.
surfaceStatic
ImageSurface
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.
Redraw()
Redraws the element.
public void Redraw()
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.