C API Unity API
Unity API Reference
VirtualButtonBehaviour Class Reference

This behaviour associates a Virtual Button with a game object. Use the functionality in ImageTargetBehaviour to create and destroy Virtual Buttons at run-time. More...

Inheritance diagram for VirtualButtonBehaviour:
ObserverBehaviour VuforiaMonoBehaviour

Public Member Functions

ImageTargetBehaviour GetImageTargetBehaviour ()
 Returns the Image Target that this Virtual Button is associated with. More...
 
void RegisterOnButtonPressed (Action< VirtualButtonBehaviour > onButtonPressedAction)
 Registers an event handler with this Virtual Button which will be called when a button is pressed More...
 
void RegisterOnButtonReleased (Action< VirtualButtonBehaviour > onButtonPressedAction)
 Registers an event handler with this Virtual Button which will be called when a button is released More...
 
bool SetArea (RectangleData area)
 Defines a new area for the button area in 3D scene units (the coordinate system is local to the ImageTarget) More...
 
bool SetSensitivity (Sensitivity sensitivity)
 Sets the sensitivity of the virtual button More...
 
bool UnregisterOnButtonPressed (Action< VirtualButtonBehaviour > onButtonPressedAction)
 Unregisters an event handler with this Virtual Button which will be called when a button has been pressed More...
 
bool UnregisterOnButtonReleased (Action< VirtualButtonBehaviour > onButtonPressedAction)
 Unregisters an event handler with this Virtual Button which will be called when a button has been released More...
 

Public Attributes

const Sensitivity DEFAULT_SENSITIVITY = Sensitivity.LOW
 The standard sensitivity More...
 
bool HasUpdatedPose => mHasUpdatedPose
 if the pose has been updated once More...
 
bool Pressed => mPressed
 Returns true if this button is currently pressed. More...
 
Sensitivity Sensitivity => mSensitivity
 Gets the sensitivity of the virtual button More...
 
const float TARGET_OFFSET = 0.001f
 The vertical offset of the graphic representation of a virtual button in respect to the target More...
 
string VirtualButtonName => mName
 The names of this virtual button. More...
 
- Public Attributes inherited from ObserverBehaviour
int ID => mObserver?.Id
 The runtime Id of the Observer More...
 
string TargetName => mTrackableName
 Name of the target of the Observer More...
 

Properties

RectangleData Area [get]
 Gets the area of the virtual button More...
 
- Properties inherited from ObserverBehaviour
TargetStatus TargetStatus [get]
 Current status information of the target More...
 

Additional Inherited Members

- Events inherited from ObserverBehaviour
Action< ObserverBehaviourOnBehaviourDestroyed
 Triggered when this behaviour is destroyed. Can be used for script cleanup More...
 
Action< ObserverBehaviour, TargetStatusOnTargetStatusChanged
 Triggered when the TargetStatus changes More...
 

Detailed Description

This behaviour associates a Virtual Button with a game object. Use the functionality in ImageTargetBehaviour to create and destroy Virtual Buttons at run-time.

Member Function Documentation

◆ GetImageTargetBehaviour()

ImageTargetBehaviour GetImageTargetBehaviour ( )
inline

Returns the Image Target that this Virtual Button is associated with.

◆ RegisterOnButtonPressed()

void RegisterOnButtonPressed ( Action< VirtualButtonBehaviour onButtonPressedAction)
inline

Registers an event handler with this Virtual Button which will be called when a button is pressed

◆ RegisterOnButtonReleased()

void RegisterOnButtonReleased ( Action< VirtualButtonBehaviour onButtonPressedAction)
inline

Registers an event handler with this Virtual Button which will be called when a button is released

◆ SetArea()

bool SetArea ( RectangleData  area)
inline

Defines a new area for the button area in 3D scene units (the coordinate system is local to the ImageTarget)

◆ SetSensitivity()

bool SetSensitivity ( Sensitivity  sensitivity)
inline

Sets the sensitivity of the virtual button

Sensitivity allows deciding between fast and robust button press measurements.

◆ UnregisterOnButtonPressed()

bool UnregisterOnButtonPressed ( Action< VirtualButtonBehaviour onButtonPressedAction)
inline

Unregisters an event handler with this Virtual Button which will be called when a button has been pressed

Returns
True on success. False otherwise

◆ UnregisterOnButtonReleased()

bool UnregisterOnButtonReleased ( Action< VirtualButtonBehaviour onButtonPressedAction)
inline

Unregisters an event handler with this Virtual Button which will be called when a button has been released

Returns
True on success. False otherwise

Member Data Documentation

◆ DEFAULT_SENSITIVITY

const Sensitivity DEFAULT_SENSITIVITY = Sensitivity.LOW

The standard sensitivity

◆ HasUpdatedPose

bool HasUpdatedPose => mHasUpdatedPose

if the pose has been updated once

◆ Pressed

bool Pressed => mPressed

Returns true if this button is currently pressed.

◆ Sensitivity

Sensitivity Sensitivity => mSensitivity

Gets the sensitivity of the virtual button

◆ TARGET_OFFSET

const float TARGET_OFFSET = 0.001f

The vertical offset of the graphic representation of a virtual button in respect to the target

◆ VirtualButtonName

string VirtualButtonName => mName

The names of this virtual button.

Property Documentation

◆ Area

RectangleData Area
get

Gets the area of the virtual button