Log in or register to post comments

isPressed() always return true

June 9, 2011 - 2:19pm #1

I'm trying to modified the VirtualButton sample code to track my own Image target with seven virtual buttons. I've got the buttons' boundary right, but button->isPressed() always return true on every visible buttons.

I've also tried setting sensitivity to LOW, but it still won't work. What am I doing wrong?

Re: isPressed() always return true

June 10, 2011 - 12:47pm #5

Hi, I've got it to work by shrinking the height of the button area by half, so that the entire button area has features. So I'm guessing my problem was caused by part of the button region has no feature?
Anyway, thanks a lot! Perhaps this should be in the best practices section in the dev guide? :)

Re: isPressed() always return true

June 10, 2011 - 12:04pm #4

Take a look at the Virtual Buttons section of the Dev Guide, there's a list of best practices.

I can't really tell what's going on from your screenshot, could you possible send the full target image and config.xml file to

?

- Kim

Re: isPressed() always return true

June 10, 2011 - 8:15am #3

Hi, I can see the virtual button boundaries rendered correctly on my screen.
It seems I only have features in part of the button area, is this the reason?

button area: http://cl.ly/3n0W412r3R1M0g3M0v2J

Re: isPressed() always return true

June 10, 2011 - 6:23am #2

Could you attach your config.xml file so we can take a look? You can use the VirtualButtons sample code to render a rectangle around your buttons, to make sure the boundaries of each button is defined correctly.

Also make sure your target has features in the button area, take a look at the feedback from the TMS system.

- Kim

Log in or register to post comments