YaUIComponent¶
YaUIComponent
adjusts the canvas in the UI.Properties¶
boolean Opaque¶
CLIENT ONLY
If true, mouse/touch events cannot pass through the empty area of the component. Default is true.
number ViewWidth¶
CLIENT ONLY
Viwe port width of the container.
number ViewHeight¶
CLIENT ONLY
View port height of the container.
Functions¶
float2 GlobalToLocal(float2 position)¶
CLIENT ONLY
Converts world position of the canvas to local position.
position
World position of the canvas
void AddChild(YaUIObject yaUIObject)¶
CLIENT ONLY
Add the ui to the canvas
void RemoveChild(YaUIObject yaUIObject)¶
CLIENT ONLY
Remove the ui to the canvas
YaUIComponent GetComponent(string name)¶
CLIENT ONLY
Gets a canvas inside the current canvas by name.
name
Name of the canvas
YaUIButton GetButton(string name)¶
CLIENT ONLY
Gets a button on the current canvas by name.
name
Name of the button
YaUIImage GetImage(string name)¶
CLIENT ONLY
Gets an image on the current canvas by name.
name
Name of the image
void SetYaUIComponentToRoot(number sortingOrder)¶
CLIENT ONLY
Moves the current canvas to the root node in UI.
sortingOrder
Displays a canvas in numeric order(0~29999)
YaUIGraph GetGraph(string name)¶
CLIENT ONLY
Gets a graph on the current canvas by name.
name
Name of the graph
YaUIList GetList(string name)¶
CLIENT ONLY
Gets a list on the current canvas by name.
name
Name of the list
YaUIObject GetChildByIndex(number index)¶
CLIENT ONLY
Gets a child controller on the current canvas by index.
index
Index of a child controller
YaUIText GetTextField(string name)¶
CLIENT ONLY
Gets a text field on the canvas by name.
name
Name of the text field
YaUITextInput GetTextInput(string name)¶
CLIENT ONLY
Gets a text input field on the current canvas by name.
name
Name of the text input field
YaUILoader GetLoader(string name)¶
CLIENT ONLY
Gets a loader on the current canvas by name.
name
Name of the loader
YaUIVideoPlayer GetVideoPlayer(string name)¶
CLIENT ONLY
Gets a video player on the current canvas by name.
name
Name of the video player
YaUISlider GetSlider(string name)¶
CLIENT ONLY
Gets a slider bar on the current canvas by name.
name
Name of the slider bar
YaUIProgressBar GetProgressBar(string name)¶
CLIENT ONLY
Gets a progress bar on the current canvas by name.
name
Name of the progress bar
Controller GetController(string name)¶
CLIENT ONLY
Gets a controller on the current canvas by name. This function is only recommended for advanced users.
name
Name of the controller
Transition GetTransition(string name)¶
CLIENT ONLY
Gets an animation component on the current canvas by name. This function is only recommended for advanced users.
name
Name of the animation
void DoDispose()¶
CLIENT ONLY
Disposes of the current canvas.