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

Control that can be clicked by the player to perform an action. More...

Inheritance diagram for Chunks.Controls.Button:
Chunks.Controls.Panel Chunks.Controls.Image Chunks.Controls.Control Chunks.Controls.CloseButton Chunks.Controls.TabContainer.TabButton

Public Member Functions

void SetColors (Color defaultColor, float hoverScale=1.5f, float pressedScale=1.25f, float disabledScale=0.75f)
 
- Public Member Functions inherited from Chunks.Controls.Control
 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)
 

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...
 
override void OnPointerEnter (PointerEventArgs e)
 Invoked when a wand pointer crosses into this button's bounds. More...
 
override void OnPointerLeave (PointerEventArgs e)
 Invoked when a wand pointer crosses out of this button's bounds. More...
 
override void OnPointerPress (PointerEventArgs e)
 Invoked when the trigger of a wand pointing at this button is pressed. More...
 
override void OnPointerRelease (PointerEventArgs e)
 Invoked when the trigger of a wand pointing at this button is released. More...
 
override void OnPointerClick (PointerEventArgs e)
 
- Protected Member Functions inherited from Chunks.Controls.Panel
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...
 
- Protected Member Functions inherited from Chunks.Controls.Image
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...
 
- Protected Member Functions inherited from Chunks.Controls.Control
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 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 ()
 

Properties

bool CanClick [get, set]
 If set to true, the button responds to pointers hovering over or pressing it. More...
 
Color DefaultColor [get, set]
 Default color of the button when no pointers are hovering over it. More...
 
Color PressedColor [get, set]
 Color of the button when a wand pointer is hovering over it with the trigger pressed. More...
 
Color HoverColor [get, set]
 Color of the button when a wand pointer is hovering over it. More...
 
Color DisabledColor [get, set]
 Color of the button when CanClick is false. More...
 
string ToolTipTitle [get, set]
 
string ToolTipDescription [get, set]
 
bool IsPointerOver [get]
 If true, at least one wand is pointing at this button. More...
 
bool IsPointerPressed [get]
 If true, at least one wand is pointing at this button with the trigger pressed. More...
 
- Properties inherited from Chunks.Controls.Image
Color Color [get, set]
 Color of the Panel. More...
 
ImageType Type [get, set]
 
bool PreserveAspect [get, set]
 
Graphics.Texture Texture [get, set]
 
Graphics.Sprite Sprite [get, set]
 
- Properties inherited from Chunks.Controls.Control
MenuPanel MenuPanel [get, set]
 
PointerEventHandler PointerEntered
 
PointerEventHandler PointerLeft
 
PointerEventHandler PointerClicked
 
PointerEventHandler PointerPressed
 
PointerEventHandler PointerReleased
 
PointerEventHandler PointerBeginDragging
 
PointerEventHandler PointerEndDragging
 
PointerEventHandler PointerDragging
 
PointerEventHandler PointerScrolling
 

Events

PointerEventHandler Clicked
 

Additional Inherited Members

- Public Attributes inherited from Chunks.Controls.Control
new ControlTransform Transform => (ControlTransform) base.Transform
 The transformation of the entity this instance is attached to. More...
 
- Protected Attributes inherited from Chunks.Controls.Image
override bool IncludeSelfInBounds => true
 
- Protected Attributes inherited from Chunks.Controls.Control
virtual bool IncludeSelfInBounds => false
 

Detailed Description

Control that can be clicked by the player to perform an action.

Member Function Documentation

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

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

override void Chunks.Controls.Button.OnPointerClick ( PointerEventArgs  e)
protectedvirtual
override void Chunks.Controls.Button.OnPointerEnter ( PointerEventArgs  e)
protectedvirtual

Invoked when a wand pointer crosses into this button's bounds.

Parameters
eInformation about the pointer event.

Reimplemented from Chunks.Controls.Control.

override void Chunks.Controls.Button.OnPointerLeave ( PointerEventArgs  e)
protectedvirtual

Invoked when a wand pointer crosses out of this button's bounds.

Parameters
eInformation about the pointer event.

Reimplemented from Chunks.Controls.Control.

override void Chunks.Controls.Button.OnPointerPress ( PointerEventArgs  e)
protectedvirtual

Invoked when the trigger of a wand pointing at this button is pressed.

Parameters
eInformation about the pointer event.

Reimplemented from Chunks.Controls.Control.

override void Chunks.Controls.Button.OnPointerRelease ( PointerEventArgs  e)
protectedvirtual

Invoked when the trigger of a wand pointing at this button is released.

Parameters
eInformation about the pointer event.

Reimplemented from Chunks.Controls.Control.

void Chunks.Controls.Button.SetColors ( Color  defaultColor,
float  hoverScale = 1.5f,
float  pressedScale = 1.25f,
float  disabledScale = 0.75f 
)

Property Documentation

bool Chunks.Controls.Button.CanClick
getset

If set to true, the button responds to pointers hovering over or pressing it.

Color Chunks.Controls.Button.DefaultColor
getset

Default color of the button when no pointers are hovering over it.

Color Chunks.Controls.Button.DisabledColor
getset

Color of the button when CanClick is false.

Color Chunks.Controls.Button.HoverColor
getset

Color of the button when a wand pointer is hovering over it.

bool Chunks.Controls.Button.IsPointerOver
get

If true, at least one wand is pointing at this button.

bool Chunks.Controls.Button.IsPointerPressed
get

If true, at least one wand is pointing at this button with the trigger pressed.

Color Chunks.Controls.Button.PressedColor
getset

Color of the button when a wand pointer is hovering over it with the trigger pressed.

string Chunks.Controls.Button.ToolTipDescription
getset
string Chunks.Controls.Button.ToolTipTitle
getset

Event Documentation

PointerEventHandler Chunks.Controls.Button.Clicked

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