Difference between revisions of "GUIContainer"

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

Revision as of 14:16, 15 January 2018

  • This is a JavaScript visible object

Remarks [edit]

Properties

float Alpha {get; set;}
int AnimateDueTime {get; set;}
int AnimateInterval {get; set;}
int AnimateTime {get;}
bool BlocksRaycasts {get; set;}
bool ClickThrough {get; set;}
int Height {get; set;}
bool IgnoreParentGroups {get; set;}
bool Interactable {get; set;}
string Name {get; set;}
float Opacity {get; set;}
bool Outline {get; set;}
Color32 OutlineColor {get; set;}
JSVector2 OutlineOffset {get; set;}
GUIRectTransform RectTransform {get; set;}
bool Shadow {get; set;}
Color32 ShadowColor {get; set;}
JSVector2 ShadowOffset {get; set;}
int SubComponents {get;}
bool Visible {get; set;}
int Width {get; set;}
Rectangle WorldRect {get;}
int X {get; set;}
int Y {get; set;}

Events

OnAnimate()
OnDisappeared()
OnResize()

Methods

void AbortDelay()
void Appear(string animationName = "")
void BringToFront()
void ClearChildren()
GUIContainer CreateComponent(string type, string componentName = NULL, string templateName = NULL)
GUIContainer CreateComponentFromTemplate(string templateName, string objectName = NULL)
void Delay(float duration, JSFlexibleFunction callback)
void Destroy()
void Disappear(string animationName = "")
GUIComponent FindChild(string searchName, bool traverse = false)
GUIComponent GetComponent(int index)
GUIComponent GetComponentByName(string componentName)
GUIComponent[] GetComponents()
void Hide(float fadeDelay = 0.1, JSFlexibleFunction callback = NULL)
bool MakeNumb()
void MakeSensitive(JSFlexibleFunction callback, bool singleClick = true)
float PlayAnimation(string animationName)
void SendToBack()
void Show(float fadeDelay = 0.1, JSFlexibleFunction callback = NULL)
void StartAnimate()
void StopAnimate()