hello everyone
i m working on an application using the virtual buttons example.
i just wanted to know that is it possible to disable a virtual button at runtime??
the requirment of the application is that initially when the app is started, buttons are shown like a menu, and when either button is pressed, both the previous buttons are disabled and a new menu consisting of 3 or 4 buttons is shown and again if a button from those buttons is pressed, then a submenu consisting of 3 new buttons is shown while disabling the previous 3/4 buttons...
is this applicaion feasible using the latest sdk 1.5.9 vuforia or the 1.5 beta sdk????
plz help :(
- Sort Posts
- 7 replies
- Last post
adding and disabling buttons at runtime
Re: adding and disabling buttons at runtime
is it possible that when the app is running and the marker has been recognized, 2 buttons show as an option to select. when either of them is selected the buttons disappear and a menu shows which further consists of 4 buttons, and then again when 1 of them is selected, all 4 of them disappear and another menu consisting of 3 buttons pops up.
im a newbie in qcar so please help :/
Re: adding and disabling buttons at runtime
You could change the configuration of virtual buttons in response to a button press, yes. I recommend setting a flag when the user presses the button in the renderFrame method (VirtualButtons.cpp), and adding/removing buttons in the next pass of the QCAR_onUpdate callback.
when either of them is selected the buttons disappear and a menu shows which further consists of 4 buttons
I'm not sure what you mean by this, are you talking about a 2D menu or something rendered on the target?
- Kim
Re: adding and disabling buttons at runtime
what im talking about is a menu meaning 4 new buttons apart from the previous two.
for example, the first two buttons that appear are an option for the user to select his/her language. once the language is selected, the menu which actually are 4 new buttons in that respective language shows up. And when one of them is selected, a sub menu consisting of 3 new buttons shows up while the previous 4 buttons dissapear.
Sure, see the toggleVirtualButton method in VirtualButtons.cpp in the VirtualButtons sample. That bit of code actually creates and destroys the buttons, but you can simply enable and disable them if you prefer:
Note that this method cannot be called while the dataset is active. See the QCAR_onUpdate method in that same file for sample code that deactivates and reactivates the dataset.
- Kim