Log in or register to post comments

Virtual Button Inconsistent

January 9, 2013 - 7:18am #1

I have a problem with the virtual button.

sometimes its detected the touch, sometimes its not.

If I read the trackable from image on the monitor it won't activate the button touch even if all my fingers covered the virtual button.

but if I read the trackable from printed image it can activate the button touch


but after I tried again on another device the button won't detect touch even if I use the printed Image.


I wonder what could be the problem? color? camera quality? or anything else?

Hi, indeed the developer

January 13, 2013 - 5:06am #7

Hi, indeed the developer guide could be a bit clearer here;

actually in Vuforia 2.0 the new class VirtualButtonResult has been introduced; the VirtualButtonResult contains the flag function "bool isPressed()", so if you are interested in reading the button status (is the button pressed or not), then you should use the VirtualButtonResult, which you can get from the ImageTargetResult  (and NOT from the ImageTarget);

on the other hand, if you are interested in knowing the name of the button or other properties (e.g. the Area, the Sensitivity, the Enabled flag, ...) then you need to use the VirtualButton class (and NOT the VirtualButtonResult), whihc you can retrieve from the ImageTarget class;

so, to summarize, VirtualButtonResults are retrieved from ImageTargetResults, while VirtualButtons are retrieved from ImageTargets;

VirtualButtonResults allow retrieveing "isPressed" status;

VirtualButtons allow retrieving all other properties of the button.

You can also check the API reference:


I hope this helps.


I'm sorry but, how is

January 13, 2013 - 1:28am #6

I'm sorry but, how is actually the right code to read the button?
should I use the Virtual button from VirtualButtonResult or I get the virtual button directly from the Image Target?

I found this tutorial is  ambiguous 


Hi, yes, the design of the

January 11, 2013 - 6:50am #5

Hi, yes, the design of the virtual button can have an impact on how well the button itself is detected (but not on the tracking of the whole image target);

one thing to keep in mind is that the virtual button itself should contain some features in it, i.e. specifying the rectangle coordinates of the button (as you do in the XML file or via code) is not sufficient to guarantee robust button detection;

for instance if your button is represented just like a uniformly coloured flat rectangle (e.g. a fully red rectangle), that is likely to be unreliable;

if, on the other hand, the button rectangle is represented by some feature-rich image, then the behaviour will be usually much better.

For the rest, position and size of the button are also important, as explained in the guide.


Thanks.   so the design of

January 11, 2013 - 5:24am #4



so the design of the virtual button is also affecting the quality of detection? I thought that just by covering the whole virtual button area it would be detected as a touch.

should the button be contrast with the background?

Hi fugougo, Alessandro is

January 9, 2013 - 8:42am #3

Hi fugougo,

Alessandro is quite right here about the design aspects of VBs.

One suggestion that some other developers are using is to have a button displayed as an augmentation so that the user can touch it on the screen.

Particularly with Unity, this is relatively straightforward to do and it's easy to detect with a simple Raycast.





Hi, the detection of Virtual

January 9, 2013 - 7:52am #2

Hi, the detection of Virtual Buttons is very sensitive to the design of them and to the surrounding image target;

there is no "general magic recipe" to have super-robust buttons, but I can invite you to have a look at the developer guide on what are the relevant parameters you can play with:


 In particular pay attention to the size and try to put them not too close to the border of the image.

I hope this helps.

Log in or register to post comments