Skip to content

YaUIObject

YaUIObject is the base class for UI management.

Properties

YaUIComponent asYaCom

CLIENT ONLY 
Forced type conversion from YaObject to YaComponent

YaUIGraph asYaGraph

CLIENT ONLY 
Forced type conversion from YaObject to YaGraph

YaUIButton asYaButton

CLIENT ONLY 
Forced type conversion from YaObject to YaButton

YaUIImage asYaImage

CLIENT ONLY 
Forced type conversion from YaObject to YaImage

YaUIList asYaList

CLIENT ONLY 
Forced type conversion from YaObject to YaList

YaUILoader asYaLoader

CLIENT ONLY 
Forced type conversion from YaObject to YaLoader

YaUIProgressBar asYaProgressBar

CLIENT ONLY 
Forced type conversion from YaObject to YaprogressBar

YaUISlider asYaSlider

CLIENT ONLY 
Forced type conversion from YaObject to YaSlider

YaUIText asYaText

CLIENT ONLY 
Forced type conversion from YaObject to YaText

YaUITextInput asYaTextInput

CLIENT ONLY 
Forced type conversion from YaObject to YaTextInput

boolean Visible

CLIENT ONLY 
Determines if the ui is visible. If true, the ui is visible; if false, the ui is not visible.

string Name

CLIENT ONLY 
Name of the ui

number SortingOrder

CLIENT ONLY 
Sets the sorting order of the button within the hierarchy of the current ui. Between 0 and 29999. The higher the number is, the closer to the root of the UI the button displays.

boolean Touchable

CLIENT ONLY 
the ui can be touched. if true, the ui can ben touch, if false, the ui can not be touch

float2 Position

CLIENT ONLY 
Sets the position of the ui.

float2 Size

CLIENT ONLY 
Sets the ui size

float2 Scale

CLIENT ONLY 
Sets the scale of the canvas.

float2 Pivot

CLIENT ONLY 
Sets the ui pivot (left | top is 0,0; right | bottom is 1,1)

number Alpha

CLIENT ONLY 
Set the ui alpha value (0~1)

boolean Draggable

CLIENT ONLY 
Sets the ui can ben Draggable

boolean Dragging

CLIENT ONLY 
The ui is dragging? (only get)

number Rotation

CLIENT ONLY 
Sets the ui rotation with the pivot

boolean Enabled

CLIENT ONLY 
Set the ui enable or disable

table Data

CLIENT ONLY 
Custom data

boolean Grayed

CLIENT ONLY 
Grays out the button

EventListener OnClick

CLIENT ONLY 
Fired when the ui is left-clicked

EventListener OnRightClick

CLIENT ONLY 
Fired when the ui is right-clicked

EventListener OnTouchBegin

CLIENT ONLY 
Fired when the ui is pressed

EventListener OnTouchMove

CLIENT ONLY 
Fired when the ui is moving

EventListener OnTouchEnd

CLIENT ONLY 
Fired when the ui is released

EventListener OnDragStart

CLIENT ONLY 
the ui drag begin

EventListener OnDragMove

CLIENT ONLY 
the ui is dragging

EventListener OnDragEnd

CLIENT ONLY 
the ui drag end

EventListener OnRollOut

CLIENT ONLY 
Fired when a finger or cursor leaves the UI element.

EventListener OnRollOver

CLIENT ONLY 
Fired when a finger touches the UI element or a cursor being put on the UI element.

EventListener OnSizeChanged

CLIENT ONLY 
the size of ui changed

Functions

GTweener TweenMove(float2 startValue, float2 endValue, number duration)

CLIENT ONLY 
Moves the UI from the startValue point to the endValue point over the given duration.
  • startValue The start point to move
  • endValue The end point to move
  • duration The duration of the movement

GTweener TweenMoveX(number startValue, number endValue, number duration)

CLIENT ONLY 
Moves the UI from the startValue point to theendValue point along the X axis over the given duration.
  • startValue The start point to move
  • endValue The end point to move
  • duration The duration of the movement

GTweener TweenMoveY(number startValue, number endValue, number duration)

CLIENT ONLY 
Moves the UI from the startValue point to theendValue point along the Y axis over the given duration.
  • startValue The start point to move
  • endValue The end point to move
  • duration The duration of the movement

GTweener TweenScale(float2 startValue, float2 endValue, number duration)

CLIENT ONLY 
Changes the scale of the UI from startValue to endValue over the given duration.
  • startValue The initial scale
  • endValue The changed scale
  • duration The duration of the scaling

GTweener TweenScaleX(number startValue, number endValue, number duration)

CLIENT ONLY 
Changes the scale of the UI from startValue to endValue along the X axis over the given duration.
  • startValue The initial scale
  • endValue The changed scale
  • duration The duration of the scaling

GTweener TweenScaleY(number startValue, number endValue, number duration)

CLIENT ONLY 
Changes the scale of the UI from startValue to endValue along the Y axis over the given duration.
  • startValue The initial scale
  • endValue The changed scale
  • duration The duration of the scaling

GTweener TweenResize(float2 startValue, float2 endValue, number duration)

CLIENT ONLY 
Resizes the UI from startValue to endValue over the given duration. Use this function when you only want to change the size of the UI and leave the texts in the UI unchanged.
  • startValue The size before the resizing
  • endValue The size after the resizing
  • duration The duration of the resizing

GTweener TweenFade(number startValue, number endValue, number duration)

CLIENT ONLY 
The UI fades in or out over the given duration.
  • startValue The initial transparency, ranging from 0 to 1
  • endValue The end transparency, ranging from 0 to 1
  • duration The duration of the fading in/out

GTweener TweenRotate(number startValue, number endValue, number duration)

CLIENT ONLY 
Rotates the UI from the startValue angle to the endValue angle around the pivot over the given duration.
  • startValue The start angle
  • endValue The end angle
  • duration The duration of the rotation

GTweener TweenRotateZ(number startValue, number endValue, number duration)

CLIENT ONLY 
Rotates the UI from the startValue angle to the endValue angle around the z-axis over the given duration.
  • startValue The start angle
  • endValue The end angle
  • duration The duration of the rotation

void SetSize(float2 size)

CLIENT ONLY 
set the ui size

void SetPosition(float2 pos)

CLIENT ONLY 
set the ui position

void MakeFullScreen()

CLIENT ONLY 
set the ui size is fullscreen

float2 UIPointToScreenPoint(float2 uiPoint)

CLIENT ONLY 
Transforms a point from the GRoot coordinate to local coordinates system.

float2 ScreenPointToUIPoint(float2 screenPoint)

CLIENT ONLY 
Transforms a point from the local coordinate system to GRoot coordinates.