YaUIObject¶
YaUIObject is the base class for UI management.Properties¶
YaUIComponent asYaCom¶
CLIENT ONLY
Forced type conversion from
YaObject to YaComponentYaUIGraph asYaGraph¶
CLIENT ONLY
Forced type conversion from
YaObject to YaGraphYaUIButton asYaButton¶
CLIENT ONLY
Forced type conversion from
YaObject to YaButtonYaUIImage asYaImage¶
CLIENT ONLY
Forced type conversion from
YaObject to YaImageYaUIList asYaList¶
CLIENT ONLY
Forced type conversion from
YaObject to YaListYaUILoader asYaLoader¶
CLIENT ONLY
Forced type conversion from
YaObject to YaLoaderYaUIProgressBar asYaProgressBar¶
CLIENT ONLY
Forced type conversion from
YaObject to YaprogressBarYaUISlider asYaSlider¶
CLIENT ONLY
Forced type conversion from
YaObject to YaSliderYaUIText asYaText¶
CLIENT ONLY
Forced type conversion from
YaObject to YaTextYaUITextInput asYaTextInput¶
CLIENT ONLY
Forced type conversion from
YaObject to YaTextInputboolean 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/Gets the position of the ui.
float2 Size¶
CLIENT ONLY
Sets the ui size
number Width¶
CLIENT ONLY
Sets/Gets the ui width
number Height¶
CLIENT ONLY
Sets/Gets the ui height
float2 Scale¶
CLIENT ONLY
Sets/Gets the scale of the canvas.
float2 Pivot¶
CLIENT ONLY
Sets/Gets the ui pivot (left | top is 0,0; right | bottom is 1,1)
number Alpha¶
CLIENT ONLY
Sets/Gets the ui alpha value (0~1)
boolean Draggable¶
CLIENT ONLY
Sets/Gets the ui can ben Draggable
boolean Dragging¶
CLIENT ONLY
The ui is dragging? (only get)
number Rotation¶
CLIENT ONLY
Sets/Gets the ui rotation with the pivot
boolean Enabled¶
CLIENT ONLY
Sets the ui enable or disable
table Data¶
CLIENT ONLY
Custom data
boolean Grayed¶
CLIENT ONLY
Grays out the button
number SourceWidth¶
CLIENT ONLY
The source width of the object.
number SourceHeight¶
CLIENT ONLY
The source height of the object.
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.
startValueThe start point to moveendValueThe end point to movedurationThe 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.
startValueThe start point to moveendValueThe end point to movedurationThe 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.
startValueThe start point to moveendValueThe end point to movedurationThe 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.
startValueThe initial scaleendValueThe changed scaledurationThe 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.
startValueThe initial scaleendValueThe changed scaledurationThe 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.
startValueThe initial scaleendValueThe changed scaledurationThe 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.
startValueThe size before the resizingendValueThe size after the resizingdurationThe duration of the resizing
GTweener TweenFade(number startValue, number endValue, number duration)¶
CLIENT ONLY
The UI fades in or out over the given duration.
startValueThe initial transparency, ranging from 0 to 1endValueThe end transparency, ranging from 0 to 1durationThe 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.
startValueThe start angleendValueThe end angledurationThe duration of the rotation
GTweener TweenRotateX(number startValue, number endValue, number duration)¶
CLIENT ONLY
Rotates the UI from the
startValue angle to the endValue angle around the x-axis over the given duration.
startValueThe start angleendValueThe end angledurationThe duration of the rotation
GTweener TweenRotateY(number startValue, number endValue, number duration)¶
CLIENT ONLY
Rotates the UI from the
startValue angle to the endValue angle around the y-axis over the given duration.
startValueThe start angleendValueThe end angledurationThe 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.