Hi i just recently started using Vuforia sdk and i have difficulties making virtual buttons ...i must say at the beggining that i tryed the sample app and well did not understand it ;/
here is what i did:
i added virtual button to the scene as a child of image targer then added plane as a child of virtual button so i can see it . Then i have written simple script to manage button actions and added that script to image targer.
public class ManageButtons : MonoBehaviour, IVirtualButtonEventHandler { // Use this for initialization void Start () { VirtualButtonBehaviour[] vbs = GetComponentsInChildren<VirtualButtonBehaviour>(); foreach (VirtualButtonBehaviour item in vbs) { item.RegisterEventHandler(this); } } // Update is called once per frame void Update () { } public void OnButtonPressed(VirtualButtonAbstractBehaviour vb) { Debug.Log("Helllllloooooooooo"); } public void OnButtonReleased(VirtualButtonAbstractBehaviour vb) { Debug.Log("Goooooodbyeeee"); } }
and it's not working ;/ can anyone indicate me to a solution
Virutal buttons are not visible by default in Play Mode.
The reason you see an outline around the Virtual Buttons in the example is because there was code written to implement that.
See the VirtualButtonsUIEventHandler.cs
I haven't experimented with this, and I'm an admitted C# N00B. But I'm pretty sure this is what you're looking for. I changed one of the vector values and could see the change reflected in the Virutal Button highlight shape when I went to Play Mode again.