By 365solution
on Wed, 10/16/2013 - 07:16
I tried to change coordinate of virtual button (in xml and cpp file). I got 5 virtual buttons:
if (buttonMask & BUTTON_1) { LOG("Toggle Button 1"); toggleVirtualButton(imageTarget, virtualButtonColors[0], -121.03f, 83.04f, -79.04f, 36.33f); } if (buttonMask & BUTTON_2) { LOG("Toggle Button 2"); toggleVirtualButton(imageTarget, virtualButtonColors[1], -121.03f, -34.6f, -79.04f, -81.31f); } if (buttonMask & BUTTON_3) { LOG("Toggle Button 3"); toggleVirtualButton(imageTarget, virtualButtonColors[2], 79.04f, 83.04f, 119.8f, 36.33f); } if (buttonMask & BUTTON_4) { LOG("Toggle Button 4"); toggleVirtualButton(imageTarget, virtualButtonColors[3], 79.04f, -34.6f, 119.8f, -81.31f); } if (buttonMask & BUTTON_5) { LOG("Toggle Button 5"); toggleVirtualButton(imageTarget, virtualButtonColors[4], -10, 10, 10, -10); }
The problem is that, only the 5th button is pressable. why the other button do not work?
Problem in virtual button coordinate
Make sure that the Virtual Buttons are all defined within the Image targets boundary and have appropriate size;
see also the developer guide - Virtual Buttons section, for more details:
Problem in virtual button coordinate
I had change several size. But only the middle(5th) button is worked. My button size is 250 x 280 and my image size is 1500 x 1050.
I had read the guide several times.
Thanks.
Problem in virtual button coordinate
Ok, this will need to be debugged a bit; for example, one thing you may try is to replace one of the 4 Buttons of the VB sample with another one (e.g. located at a slightly different position) and see what happens.
Problem in virtual button coordinate
Thanks. It works now. I changed the Sensitivity to low, it work better.
Now, I would like to add sound, but when i run the app, it cannot be run, where it show a message said the application is stopped unexpectedly and need to force stop.
This is my code in cpp:
Problem in virtual button coordinate
Glad to hear that is now works!
Concerning the Sound effect, make sure that the Java method playSound is in the right class and has the right signature (corresponding to the JNI C++ code that you have written to invoke it)... but note that how to play sounds is not Vuforia-related.
Problem in virtual button coordinate