Chunks
Moddable voxel sandbox for room-scale VR.
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Chunks.Controls.Control Class Reference

Base class for graphical user interface controls that can be displayed and interacted with on a MenuPanel. More...

Inheritance diagram for Chunks.Controls.Control:
Chunks.Controls.Image Chunks.Controls.MenuParent Chunks.Controls.RowList Chunks.Controls.ScrollView Chunks.Controls.TabContainer Chunks.Controls.Text Chunks.Controls.Mask Chunks.Controls.Panel Chunks.Controls.Button Chunks.Controls.InfoPanel Chunks.Controls.SettingsMenu Chunks.Controls.SettingsMenu.SliderSetting Chunks.Controls.SettingsMenu.ToggleSetting Chunks.Controls.Slider Chunks.Controls.TabPage Chunks.Controls.WorldMenu

Public Member Functions

 Control ()
 
TControl CreateChildControl< TControl > ()
 Creates a new Entity as a child of this one with an instance of the given Control type attached to it, which is returned. More...
 
Control CreateChildControl (Type type)
 Creates a new Entity as a child of this one with an instance of the given Control type attached to it, which is returned. More...
 
Control CreateChildControl (ResourceName resName)
 Creates a new Entity as a child of this one with a Control attached to it, as defined by the control layout resource specified by the given resource name. More...
 
Bounds GetChildBounds ()
 
delegate void PointerEventHandler (Control sender, PointerEventArgs e)
 
void SetTextSubstitution (string key, string value)
 
string GetTextSubstitution (string key)
 

Public Attributes

new ControlTransform Transform => (ControlTransform) base.Transform
 The transformation of the entity this instance is attached to. More...
 

Protected Member Functions

override void OnInitialize ()
 Called only once, when the component is first attached to an entity and is ready to add or retrieve other components. More...
 
ResourceName GetResourceName (JToken token)
 Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadJson. More...
 
virtual void OnChildLoadedFromLayout (Control child)
 Invoked when a new child is created as specified by a json layout object. More...
 
virtual void OnLayoutLoaded (bool firstTime)
 Invoked when the control's layout has been (re)loaded. More...
 
virtual bool GetChildBounds (out Bounds bounds)
 
override void OnUpdate ()
 Called once per world update if this component and its parent entity are enabled. More...
 
virtual void OnPointerEnter (PointerEventArgs e)
 
virtual void OnPointerLeave (PointerEventArgs e)
 
virtual void OnPointerClick (PointerEventArgs e)
 
virtual void OnPointerPress (PointerEventArgs e)
 
virtual void OnPointerRelease (PointerEventArgs e)
 
virtual void OnPointerBeginDrag (PointerEventArgs e)
 
virtual void OnPointerEndDrag (PointerEventArgs e)
 
virtual void OnPointerDrag (PointerEventArgs e)
 
virtual void OnPointerScroll (PointerEventArgs e)
 
string GetSubstitutedText (string format)
 
virtual void OnUpdateTextSubstitutions ()
 

Protected Attributes

virtual bool IncludeSelfInBounds => false
 

Properties

MenuPanel MenuPanel [get, set]
 
PointerEventHandler PointerEntered
 
PointerEventHandler PointerLeft
 
PointerEventHandler PointerClicked
 
PointerEventHandler PointerPressed
 
PointerEventHandler PointerReleased
 
PointerEventHandler PointerBeginDragging
 
PointerEventHandler PointerEndDragging
 
PointerEventHandler PointerDragging
 
PointerEventHandler PointerScrolling
 

Detailed Description

Base class for graphical user interface controls that can be displayed and interacted with on a MenuPanel.

Constructor & Destructor Documentation

Chunks.Controls.Control.Control ( )

Member Function Documentation

Control Chunks.Controls.Control.CreateChildControl ( Type  type)

Creates a new Entity as a child of this one with an instance of the given Control type attached to it, which is returned.

Parameters
typeType of the control to create.
Control Chunks.Controls.Control.CreateChildControl ( ResourceName  resName)

Creates a new Entity as a child of this one with a Control attached to it, as defined by the control layout resource specified by the given resource name.

Parameters
resNameResource name of the control layout.

Creates a new Entity as a child of this one with an instance of the given Control type attached to it, which is returned.

Template Parameters
TControlType of the control to create.
Type Constraints
TControl :Control 
TControl :new() 
Bounds Chunks.Controls.Control.GetChildBounds ( )
virtual bool Chunks.Controls.Control.GetChildBounds ( out Bounds  bounds)
protectedvirtual

Reimplemented in Chunks.Controls.Mask.

ResourceName Chunks.Controls.Control.GetResourceName ( JToken  token)
protected

Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadJson.

Parameters
tokenToken to convert to a resource name
string Chunks.Controls.Control.GetSubstitutedText ( string  format)
protected
string Chunks.Controls.Control.GetTextSubstitution ( string  key)
virtual void Chunks.Controls.Control.OnChildLoadedFromLayout ( Control  child)
protectedvirtual

Invoked when a new child is created as specified by a json layout object.

Parameters
childThe newly created child.

Reimplemented in Chunks.Controls.TabContainer, Chunks.Controls.RowList, and Chunks.Controls.ScrollView.

override void Chunks.Controls.Control.OnInitialize ( )
protected

Called only once, when the component is first attached to an entity and is ready to add or retrieve other components.

virtual void Chunks.Controls.Control.OnLayoutLoaded ( bool  firstTime)
protectedvirtual
virtual void Chunks.Controls.Control.OnPointerBeginDrag ( PointerEventArgs  e)
protectedvirtual
virtual void Chunks.Controls.Control.OnPointerClick ( PointerEventArgs  e)
protectedvirtual
virtual void Chunks.Controls.Control.OnPointerDrag ( PointerEventArgs  e)
protectedvirtual
virtual void Chunks.Controls.Control.OnPointerEndDrag ( PointerEventArgs  e)
protectedvirtual
virtual void Chunks.Controls.Control.OnPointerEnter ( PointerEventArgs  e)
protectedvirtual

Reimplemented in Chunks.Controls.Button.

virtual void Chunks.Controls.Control.OnPointerLeave ( PointerEventArgs  e)
protectedvirtual

Reimplemented in Chunks.Controls.Button.

virtual void Chunks.Controls.Control.OnPointerPress ( PointerEventArgs  e)
protectedvirtual

Reimplemented in Chunks.Controls.Button.

virtual void Chunks.Controls.Control.OnPointerRelease ( PointerEventArgs  e)
protectedvirtual

Reimplemented in Chunks.Controls.Button.

virtual void Chunks.Controls.Control.OnPointerScroll ( PointerEventArgs  e)
protectedvirtual

Reimplemented in Chunks.Controls.ScrollView.

override void Chunks.Controls.Control.OnUpdate ( )
protected

Called once per world update if this component and its parent entity are enabled.

virtual void Chunks.Controls.Control.OnUpdateTextSubstitutions ( )
protectedvirtual

Reimplemented in Chunks.Controls.Text.

delegate void Chunks.Controls.Control.PointerEventHandler ( Control  sender,
PointerEventArgs  e 
)
void Chunks.Controls.Control.SetTextSubstitution ( string  key,
string  value 
)

Member Data Documentation

virtual bool Chunks.Controls.Control.IncludeSelfInBounds => false
protected
new ControlTransform Chunks.Controls.Control.Transform => (ControlTransform) base.Transform

The transformation of the entity this instance is attached to.

Property Documentation

MenuPanel Chunks.Controls.Control.MenuPanel
getset
PointerEventHandler Chunks.Controls.Control.PointerBeginDragging
addremove
PointerEventHandler Chunks.Controls.Control.PointerClicked
addremove
PointerEventHandler Chunks.Controls.Control.PointerDragging
addremove
PointerEventHandler Chunks.Controls.Control.PointerEndDragging
addremove
PointerEventHandler Chunks.Controls.Control.PointerEntered
addremove
PointerEventHandler Chunks.Controls.Control.PointerLeft
addremove
PointerEventHandler Chunks.Controls.Control.PointerPressed
addremove
PointerEventHandler Chunks.Controls.Control.PointerReleased
addremove
PointerEventHandler Chunks.Controls.Control.PointerScrolling
addremove

The documentation for this class was generated from the following files: