Difference between revisions of "GUIContainer"
From Virtual World Web Wiki
(Documentation for the GUIContainer class) |
(Documentation for the GUIContainer class) |
||
Line 63: | Line 63: | ||
:: | :: | ||
::Sets an offset for the Outline component | ::Sets an offset for the Outline component | ||
+ | |||
+ | :{{CSharp|bool PassThrough {get; set;} }} | ||
:{{CSharp|GUIRectTransform RectTransform {get; set;} }} | :{{CSharp|GUIRectTransform RectTransform {get; set;} }} |
Revision as of 12:33, 23 May 2018
A base class for all hierachical GUI windows and components
- This is a JavaScript visible object
Remarks [edit]
Properties
- float Alpha {get; set;}
- Sets the Alpha on the CanvasGroup of this object (which applies to children)
- int AnimateDueTime {get; set;}
- Number of milliseconds to wait after StartAnimate() before the first OnAnimate callback fires
- int AnimateInterval {get; set;}
- Minimum number of milliseconds between Animate calls
- int AnimateTime {get;}
- How many milliseconds since StartAnimate() was called
- bool BlocksRaycasts {get; set;}
- Sets "BlocksRaycast" value on this object's CanvasGroup - without BlocksRaycast, this object will allow objects underneath it to receive clicks and hovers instead of itself
- bool ClickThrough {get; set;}
- Ignore this container for determining if the user can click and rotate their camera.
- bool FreezeRotation {get; set;}
- int Height {get; set;}
- The Y sizeDelta of this container
- bool IgnoreParentGroups {get; set;}
- Allows this object's CanvasGroup to override parent CanvasGroup properties (like BlocksRaycasts or Alpha)
- bool Interactable {get; set;}
- Enables/disables interactivity of this object's CanvasGroup (which applies to children)
- string Name {get; set;}
- The internal name for the GUIContainer
- float Opacity {get; set;}
- Sets the opacity (alpha) on the CanvasRenderer of this object (which does not apply to children), allowing for variable transparency effects
- bool Outline {get; set;}
- Apply an Outline component to this container
- Color32 OutlineColor {get; set;}
- Sets a color for the Outline component
- JSVector2 OutlineOffset {get; set;}
- Sets an offset for the Outline component
- bool PassThrough {get; set;}
- GUIRectTransform RectTransform {get; set;}
- Reference to the container's RectTransform
- bool Shadow {get; set;}
- Apply a Shadow component to this container
- Color32 ShadowColor {get; set;}
- Sets a color for the Shadow component
- JSVector2 ShadowOffset {get; set;}
- Sets an offset for the Shadow component
- int SubComponents {get;}
- Number of child components
- bool Visible {get; set;}
- Whether or not to display this object and its children
- int Width {get; set;}
- The X sizeDelta of this container
- Rectangle WorldRect {get;}
- Gets the screen-space coordinates of this container and returns them as a rectangle {x, y, width, height}
- int X {get; set;}
- The anchored X position of this container
- int Y {get; set;}
- The anchored Y position of this container
Events
- OnAnimate()
- Fires every AnimateInterval milliseconds after StartAnimate() is called. Never called more often than once per render frame
- OnDisappeared()
- Event fired when the Disappear() function completes
- OnResize()
- Event fired each time the size of the component changes
Methods
- void AbortDelay()
- Abort the current delay timer
- void Appear(string animationName = "")
- Causes the container to appear using its animator
- void BringToFront()
- Move container to front of the parent's ordering - this will cause reordering if done inside LayoutGroups
- void ClearChildren()
- Remove all children from this container
- GUIContainer CreateComponent(string type, string componentName = NULL, string templateName = NULL)
- Creates a new component as a child of this container.
- GUIContainer CreateComponentFromTemplate(string templateName, string objectName = NULL)
- Creates a new component under this container of the specified template
- void Delay(float duration, JSFlexibleFunction callback)
- Call back a particular function after a given number of seconds
- void Destroy()
- Destroy this container and all children
- void Disappear(string animationName = "")
- Causes the container to disappear using its animator
- GUIComponent FindChild(string searchName, bool traverse = false)
- Finds a child node matching a given name, optionally traversing breadth first through children until it's found.
- GUIComponent GetComponent(int index)
- Returns the indexed component from this container
- GUIComponent GetComponentByName(string componentName)
- Returns the first child component with a given name
- GUIComponent[] GetComponents()
- Gets an array of components from this container
- void Hide(float fadeDelay = 0.1, JSFlexibleFunction callback = NULL)
- Fade component out from visible and to 0 Alpha and not visible
- bool MakeNumb()
- Ends the sensitivity of a component (see: MakeSensitive)
- void MakeSensitive(JSFlexibleFunction callback, bool singleClick = true)
- Provides a function callback when the user clicks and whether the click occured on or off the object
- float PlayAnimation(string animationName)
- Causes the container to play a particular animation
- void SendToBack()
- Move container to back of the parent's ordering - this will cause reordering if done inside LayoutGroups
- void Show(float fadeDelay = 0.1, JSFlexibleFunction callback = NULL)
- Fade component in from not visible and 0 Alpha to visible and full Alpha
- void StartAnimate()
- Start the animate timer callbacks
- void StopAnimate()
- Stop the animate timer callbacks