Virtual buttons provide a useful mechanism for making image-based targets interactive. Handle the events with
OnButtonReleased when the button is visually obstructed from the camera. When creating a Virtual Button, the size and placement must be considered carefully with respect to the user experience. There are several factors that will affect the responsiveness and usability of Virtual buttons.
- The length and width of the button.
- The area of the target that it covers.
- The placement of the button in relation to both the border of the image, and other buttons on the target.
- The underlying area of the button has a high contrast and detail so that events are easily activated.
Design and Placement
The rectangle that you define for the area of a Virtual button should be equal to, or greater than, 10% of the overall target area. Button events are triggered when a significant proportion of the features underlying the area of the button are concealed from the camera. This can occur when the user covers the button or otherwise blocks it in the camera view. For this reason, the button should be sized appropriately for the source of the action it is intended to respond to. For example, a button that should be triggered by a user's finger needs to be smaller than one that will be triggered by their entire hand.
Virtual Buttons can be assigned multiple sensitivities, which define how readily the button's
OnButtonPressed will fire.
Buttons with a HIGH sensitivity will fire more easily than those with a LOW sensitivity. The button's sensitivity is a reflection of the proportion of the button area that must be covered, and the coverage time. It's advisable to test the responsiveness of each of your buttons in a real-world setting to verify that they perform as expected.
Place Over Features
Virtual Buttons detect when underlying features of the target image are obscured from the camera view. You will need to place your button over an area of the image that is rich in features in order for it to reliably fire its
OnButtonPressed event. To determine where these features are in your image, use the Show Features link on your image in the Target Manager. You will see the available features marked with yellow hatch marks as in the example image below.