SCRIPTING API / UI / UI
UI
Runtime UI action helpers for scripts.
Kindclass
NamespaceKroys.EngineScripting
Members10
Source
UI.csDECLARATION
Declaration
Namespace Kroys.EngineScripting.
Declaration
public static class UI
REFERENCE
Members
Methods
#public static bool IsActionClicked(string action)Returns true on the frame after a runtime UI widget with the given action was clicked.
#public static bool SetVisible(Entity canvas, string widgetId, bool visible)Overrides widget text on this canvas until play stops. The document asset is unchanged.
#public static bool SetProgress(Entity canvas, string widgetId, float value)Sets a progress bar or slider, from 0 to 1.
#public static bool SetBackground(Entity canvas, string widgetId, float red, float green, float blue, float alpha)Replaces a widget's background, as for a selected row.
#public static bool SetOffset(Entity canvas, string widgetId, float x, float y)Moves a widget from its anchor, in the document's reference pixels, until Play ends.
#public static bool TryGetSliderValue(string action, out float value)Reads a slider the player released this frame, by its action name.
#public static bool TryGetActionValue(string action, out float value)Reads what a widget reported this frame: a slider position, a toggle (0 or 1) or a dropdown index.
#public static bool TryGetActionText(string action, out string text)Reads an input field's text on the frame it was confirmed with Enter or by clicking away.
#public static bool SetText(Entity canvas, string widgetId, string text)Sets the text of a widget on a UI canvas entity; false when the canvas or widget id does not exist.
#public static UIWidget GetWidget(Entity canvas, string widgetId)The widget with this id on a UI canvas, for data binding: set its text, value or visibility and subscribe to
UIWidget.OnClick / UIWidget.OnChanged. The same object is returned for the same canvas and id.Signatures
public static bool IsActionClicked(string action) public static bool SetVisible(Entity canvas, string widgetId, bool visible) public static bool SetProgress(Entity canvas, string widgetId, float value) public static bool SetBackground(Entity canvas, string widgetId, float red, float green, float blue, float alpha) public static bool SetOffset(Entity canvas, string widgetId, float x, float y) public static bool TryGetSliderValue(string action, out float value) public static bool TryGetActionValue(string action, out float value) public static bool TryGetActionText(string action, out string text) public static bool SetText(Entity canvas, string widgetId, string text) public static UIWidget GetWidget(Entity canvas, string widgetId)
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.