Class GuiElementSlider
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementSlider : GuiElementControl, IDisposable
- Inheritance
-
GuiElementSlider
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementSlider(ICoreClientAPI, ActionConsumable<int>, ElementBounds)
Builds a slider. A horizontal customizeable slider.
public GuiElementSlider(ICoreClientAPI capi, ActionConsumable<int> onNewSliderValue, ElementBounds bounds)
Parameters
capi
ICoreClientAPIThe Client API
onNewSliderValue
ActionConsumable<int>The event that's fired when the slider changed.
bounds
ElementBoundsthe bounds of the object.
Fields
OnSliderRestingText
public SliderTooltipDelegate OnSliderRestingText
Field Value
OnSliderTooltip
public SliderTooltipDelegate OnSliderTooltip
Field Value
Properties
Enabled
Enables/disables the given element (default is enabled)
public override bool Enabled { get; set; }
Property Value
Focusable
Whether or not the element can be focused.
public override bool Focusable { get; }
Property Value
ShowTextWhenResting
public bool ShowTextWhenResting { get; set; }
Property Value
TooltipExceedClipBounds
public bool TooltipExceedClipBounds { get; set; }
Property Value
Methods
AddSkipValue(int)
public void AddSkipValue(int skipValue)
Parameters
skipValue
int
ClearSkipValues()
public void ClearSkipValues()
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctxStatic, ImageSurface surfaceStatic)
Parameters
ctxStatic
ContextThe context of the components.
surfaceStatic
ImageSurface
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
GetValue()
Gets the current value of the slider.
public int GetValue()
Returns
OnKeyDown(ICoreClientAPI, KeyEvent)
The event fired when a key is held down.
public override void OnKeyDown(ICoreClientAPI api, KeyEvent args)
Parameters
api
ICoreClientAPIThe client API
args
KeyEventThe key event arguments.
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.
OnMouseUp(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe arguments for the mouse event.
OnMouseWheel(ICoreClientAPI, MouseWheelEventArgs)
The event fired when the mouse wheel is scrolled.
public override void OnMouseWheel(ICoreClientAPI api, MouseWheelEventArgs args)
Parameters
api
ICoreClientAPIThe Client API
args
MouseWheelEventArgsThe mouse wheel arguments.
RemoveSkipValue(int)
public void RemoveSkipValue(int skipValue)
Parameters
skipValue
int
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
SetAlarmValue(int)
Sets a value to warn the player that going over this is not a good idea.
public void SetAlarmValue(int value)
Parameters
value
intThe maximum limit before things break down.
SetSkipValues(HashSet<int>)
public void SetSkipValues(HashSet<int> skipValues)
Parameters
SetValue(int)
public void SetValue(int currentValue)
Parameters
currentValue
int
SetValues(int, int, int, int, string)
Sets the values of the slider.
public void SetValues(int currentValue, int minValue, int maxValue, int step, string unit = "")