QuadUI 1.2.9 public beta
Run-time API for QuadUI

Toggle2D Class Reference

Inheritance diagram for Toggle2D:
InteractiveElement2D Element2D EventDispatcher

List of all members.

Public Member Functions

void Toggle ()
sealed override void Enable ()
sealed override void Disable ()
void SetVal (bool val)

Public Attributes

bool dimOnDisable = true

Protected Member Functions

virtual void Init ()
virtual void On ()
virtual void Off ()
virtual void OnToggle ()

Properties

bool val [get]
Vector2 onUV [get]
Vector2 offUV [get]
Vector2 onOverUV [get]
Vector2 offOverUV [get]

Detailed Description

Basic Toggle class. Contains States for On, On-Over, Off, and Off-Over.

Note: Over states are not available under iOS/Android Build Settings.


Member Function Documentation

sealed override void Toggle2D.Disable ( ) [virtual]

Extended version of InteractiveElement2D.Disable() to integrate a dimmer on enable/disable. See related Toggle2D.dimOnDisable.

Reimplemented from InteractiveElement2D.

sealed override void Toggle2D.Enable ( ) [virtual]

Extended version of InteractiveElement2D.Enable() to integrate a dimmer on enable/disable. See related Toggle2D.dimOnDisable.

Reimplemented from InteractiveElement2D.

virtual void Toggle2D.Init ( ) [protected, virtual]

Use this hook for any generic initialization.

Note: This is not called automatically by the framework, this is something you will have to call yourself.

virtual void Toggle2D.Off ( ) [protected, virtual]

Hook called when toggle is switched Off.

virtual void Toggle2D.On ( ) [protected, virtual]

Hook called when toggle is switched On.

virtual void Toggle2D.OnToggle ( ) [protected, virtual]

Generic hook called from Toggle(), not state specific like On() and Off().

Note: This is called after On or Off

void Toggle2D.SetVal ( bool  val)

Toggles the button On and Off respectively. If the button is to be turned off by this function, the hook Off() will be called, otherwise the hook On() will be called.

void Toggle2D.Toggle ( )

Toggles the button On and Off respectively. If the button is to be turned off by this function, the hook Off() will be called, otherwise the hook On() will be called. Additionally, the hook OnToggle is called any time this function of called regardless of state.


Member Data Documentation

bool Toggle2D.dimOnDisable = true

If true, when this element is disabled by calling Disable() (not to be confused will MonoBehavior.enable, please see Interactive2DElement.Enable() for details) it will set the material's color to new Color(1,1,1,.25F) (25% opacity) and by calling Enable() back to Color.white.


Property Documentation

Vector2 Toggle2D.offOverUV [get]

Returns a Vector2 representation of the top-left UV coordinate for the "Off" state, but with a MouseOver state. This is the same as frames[1]

Note: MouseOver states are not available under iOS/Android Build Settings

Vector2 Toggle2D.offUV [get]

Returns a Vector2 representation of the top-left UV coordinate for the "Off" state. This is the same as frames[0]

Vector2 Toggle2D.onOverUV [get]

Returns a Vector2 representation of the top-left UV coordinate for the "On" state, but with a MouseOver state. This is the same as frames[3]

Note: MouseOver states are not available under iOS/Android Build Settings

Vector2 Toggle2D.onUV [get]

Returns a Vector2 representation of the top-left UV coordinate for the "On" state. This is the same as frames[2]

bool Toggle2D.val [get]

Is the toggle on?

 All Classes Functions Variables Enumerations Properties