Log in or register to post comments

VirtualButtons on a ImageTarget

June 1, 2011 - 4:56am #1

Hi,

Is it possible to put a VirtualButton on a MultiTarget?

For example, I wanna put a rectangle VirtualButton at the front of the Lion Flakes box, instead of the lion's head. And the texture of the bowl moving around could change when we pressed on that button...

I think it could be possible, because a MultiTarget is composed of several ImageTargets, and each ImageTarget can contains a VirtualButton...

I tried some things, but it does not work! It is hard to explain exactly what I did, because I had to modify different classes, but I will try to :

-In config.xml, I replaced

by


For the menu :
-In res/values/strings, I added the String relative to the VirtualButton
-In res/drawable, I added the button's icon
-In MultiTargets.java, I added the MENU_BUTTON in the menu (in OnCreateOptionsMenu)

-Always in MultiTargets.java, to modify the OnOptionsItemSelected method, I had to declare the addButtonToToggle native method, and implement it in MultiTargets.cpp (where I had to declare all the variables related to this, like updateBtns, buttonMask, etc...)

-In MultiTargets.cpp, I modified the UpdateCallBack method, and created the Toggle VirtualButtons method.

Re: VirtualButtons on a ImageTarget

June 2, 2011 - 11:31am #5

There seems to be a bug with detecting multi targets and image targets simultaneously. For now, it seems to work if you detect the multi target first (try that during your development). Hopefully we'll have a fix for the bug in our next release, no dates yet though.

- Kim

Re: VirtualButtons on a ImageTarget

June 2, 2011 - 1:42am #4

Ok thanks!

Do you know when the update will be available?

Re: VirtualButtons on a ImageTarget

June 1, 2011 - 12:33pm #3

To answer your first question, virtual buttons on multi targets is not a supported feature. I'll have an update on your second question later (it seems to work, but not in all cases).

- Kim

Re: VirtualButtons on a ImageTarget

June 1, 2011 - 7:51am #2

And I have a second question : is it possible to detect simultaneously a MultiTarget and an ImageTarget?

Log in or register to post comments