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 4: Line 4:
  
 
===Properties===
 
===Properties===
:{{CSharp|Single Alpha {get; set;} }}
+
:{{CSharp|float Alpha {get; set;} }}
 
::
 
::
 
::Sets the Alpha on the CanvasGroup of this object (which applies to children)
 
::Sets the Alpha on the CanvasGroup of this object (which applies to children)
Line 42: Line 42:
 
:{{CSharp|string Name {get; set;} }}
 
:{{CSharp|string Name {get; set;} }}
  
:{{CSharp|Single 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
 
::Sets the opacity (alpha) on the CanvasRenderer of this object (which does not apply to children), allowing for variable transparency effects
Line 108: Line 108:
  
 
===Methods===
 
===Methods===
:{{CSharp|void Appear(string animationName)}}
+
:{{CSharp|void Appear(string animationName {{=}} "")}}
 
::
 
::
 
::Causes the container to appear using its animator
 
::Causes the container to appear using its animator
Line 120: Line 120:
 
::Remove all children from this container
 
::Remove all children from this container
  
:{{CSharp|GUIContainer CreateComponent(string type, string componentName, string templateName)}}
+
:{{CSharp|GUIContainer CreateComponent(string type, string componentName {{=}} NULL, string templateName {{=}} NULL)}}
  
:{{CSharp|GUIContainer CreateComponentFromTemplate(string templateName, string objectName)}}
+
:{{CSharp|GUIContainer CreateComponentFromTemplate(string templateName, string objectName {{=}} NULL)}}
 
::
 
::
 
::Creates a new component under this container of the specified template
 
::Creates a new component under this container of the specified template
  
:{{CSharp|void Delay(Single duration, JSFlexibleFunction callback)}}
+
:{{CSharp|void Delay(float duration, JSFlexibleFunction callback)}}
 
::
 
::
 
::Call back a particular function after a given number of seconds
 
::Call back a particular function after a given number of seconds
Line 134: Line 134:
 
::Destroy this container and all children
 
::Destroy this container and all children
  
:{{CSharp|void Disappear(string animationName)}}
+
:{{CSharp|void Disappear(string animationName {{=}} "")}}
 
::
 
::
 
::Causes the container to disappear using its animator
 
::Causes the container to disappear using its animator
  
:{{CSharp|GUIComponent FindChild(string byName, bool traverse)}}
+
:{{CSharp|GUIComponent FindChild(string byName, bool traverse {{=}} false)}}
  
 
:{{CSharp|GUIComponent GetComponent(int index)}}
 
:{{CSharp|GUIComponent GetComponent(int index)}}
Line 152: Line 152:
 
::Gets an array of components from this container
 
::Gets an array of components from this container
  
:{{CSharp|void Hide(Single fadeDelay, JSFlexibleFunction callback)}}
+
:{{CSharp|void Hide(float fadeDelay {{=}} 0.1, JSFlexibleFunction callback {{=}} NULL)}}
 
::
 
::
 
::Fade component out from visible and to 0 Alpha and not visible
 
::Fade component out from visible and to 0 Alpha and not visible
Line 160: Line 160:
 
::Ends the sensitivity of a component (see: MakeSensitive)
 
::Ends the sensitivity of a component (see: MakeSensitive)
  
:{{CSharp|void MakeSensitive(JSFlexibleFunction callback, bool singleClick)}}
+
:{{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
 
::Provides a function callback when the user clicks and whether the click occured on or off the object
  
:{{CSharp|GUIButton NewButton(string componentName)}}
+
:{{CSharp|GUIButton NewButton(string componentName {{=}} "")}}
  
:{{CSharp|GUIChatSurface NewChatSurface(string componentName)}}
+
:{{CSharp|GUIChatSurface NewChatSurface(string componentName {{=}} "")}}
  
:{{CSharp|GUICollapsiblePanel NewCollapsiblePanel(string componentName)}}
+
:{{CSharp|GUICollapsiblePanel NewCollapsiblePanel(string componentName {{=}} "")}}
  
:{{CSharp|GUILargeColorPicker NewColorPicker(string componentName)}}
+
:{{CSharp|GUILargeColorPicker NewColorPicker(string componentName {{=}} "")}}
  
:{{CSharp|GUIComboBox NewComboBox(string componentName)}}
+
:{{CSharp|GUIComboBox NewComboBox(string componentName {{=}} "")}}
  
:{{CSharp|GUIDragItem NewDragItem(string componentName)}}
+
:{{CSharp|GUIDragItem NewDragItem(string componentName {{=}} "")}}
  
:{{CSharp|GUIFilePicker NewFilePicker(string componentName)}}
+
:{{CSharp|GUIFilePicker NewFilePicker(string componentName {{=}} "")}}
  
:{{CSharp|GUIGrid NewGrid(string componentName)}}
+
:{{CSharp|GUIGrid NewGrid(string componentName {{=}} "")}}
  
:{{CSharp|GUIImageBox NewImageBox(string componentName)}}
+
:{{CSharp|GUIImageBox NewImageBox(string componentName {{=}} "")}}
  
:{{CSharp|GUILabel NewLabel(string componentName)}}
+
:{{CSharp|GUILabel NewLabel(string componentName {{=}} "")}}
  
:{{CSharp|GUIMenu NewMenu(string componentName)}}
+
:{{CSharp|GUIMenu NewMenu(string componentName {{=}} "")}}
  
:{{CSharp|GUIPanel NewPanel(string componentName)}}
+
:{{CSharp|GUIPanel NewPanel(string componentName {{=}} "")}}
  
:{{CSharp|GUIToggle NewRadioButton(string componentName)}}
+
:{{CSharp|GUIToggle NewRadioButton(string componentName {{=}} "")}}
  
:{{CSharp|GUIScrollBox NewScrollBox(string componentName)}}
+
:{{CSharp|GUIScrollBox NewScrollBox(string componentName {{=}} "")}}
  
:{{CSharp|GUISlider NewSlider(string componentName)}}
+
:{{CSharp|GUISlider NewSlider(string componentName {{=}} "")}}
  
:{{CSharp|GUITabControl NewTabControl(string componentName)}}
+
:{{CSharp|GUITabControl NewTabControl(string componentName {{=}} "")}}
  
:{{CSharp|GUITextArea NewTextArea(string componentName)}}
+
:{{CSharp|GUITextArea NewTextArea(string componentName {{=}} "")}}
  
:{{CSharp|GUITextField NewTextField(string componentName)}}
+
:{{CSharp|GUITextField NewTextField(string componentName {{=}} "")}}
  
:{{CSharp|GUITree NewTree(string componentName)}}
+
:{{CSharp|GUITree NewTree(string componentName {{=}} "")}}
  
:{{CSharp|GUIWebView NewWebPage(string componentName)}}
+
:{{CSharp|GUIWebView NewWebPage(string componentName {{=}} "")}}
  
:{{CSharp|Single PlayAnimation(string animationName)}}
+
:{{CSharp|float PlayAnimation(string animationName)}}
 
::
 
::
 
::Causes the container to play a particular animation
 
::Causes the container to play a particular animation
Line 212: Line 212:
 
::Move container to back of the parent's ordering - this will cause reordering if done inside LayoutGroups
 
::Move container to back of the parent's ordering - this will cause reordering if done inside LayoutGroups
  
:{{CSharp|void Show(Single fadeDelay, JSFlexibleFunction callback)}}
+
:{{CSharp|void Show(float fadeDelay {{=}} 0.1, JSFlexibleFunction callback {{=}} NULL)}}
 
::
 
::
 
::Fade component in from not visible and 0 Alpha to visible and full Alpha
 
::Fade component in from not visible and 0 Alpha to visible and full Alpha

Revision as of 17:56, 20 February 2017

  • 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.
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;}
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
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(EventHandler<FlexibleEventArgs>)
Fires every AnimateInterval milliseconds after StartAnimate() is called. Never called more often than once per render frame
OnDisappeared(EventHandler<FlexibleEventArgs>)
Event fired when the Disappear() function completes

Methods

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)
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 byName, bool traverse = false)
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
GUIButton NewButton(string componentName = "")
GUIChatSurface NewChatSurface(string componentName = "")
GUICollapsiblePanel NewCollapsiblePanel(string componentName = "")
GUILargeColorPicker NewColorPicker(string componentName = "")
GUIComboBox NewComboBox(string componentName = "")
GUIDragItem NewDragItem(string componentName = "")
GUIFilePicker NewFilePicker(string componentName = "")
GUIGrid NewGrid(string componentName = "")
GUIImageBox NewImageBox(string componentName = "")
GUILabel NewLabel(string componentName = "")
GUIMenu NewMenu(string componentName = "")
GUIPanel NewPanel(string componentName = "")
GUIToggle NewRadioButton(string componentName = "")
GUIScrollBox NewScrollBox(string componentName = "")
GUISlider NewSlider(string componentName = "")
GUITabControl NewTabControl(string componentName = "")
GUITextArea NewTextArea(string componentName = "")
GUITextField NewTextField(string componentName = "")
GUITree NewTree(string componentName = "")
GUIWebView NewWebPage(string componentName = "")
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