Log in or register to post comments

How to open a web/FB/twitter w/ virtualbutton

February 24, 2012 - 12:34pm #1

Hi! I'm starting developing for Vuforia and Android devices in general. I tried to use the new 1.5 version but I couldn't build the trial scenes, now im using 1.0.6

I want to open a website, a facebook, a twitter or a video in the phone when the person press the virtualbutton.

Its that possible with VirtualButtonEventHandler ??

(Please make as much detailed as possible the answers because im new at Cellphone development!!!)

Thank you very much!
Pascual from argentina

How to open a web/FB/twitter w/ virtualbutton

April 14, 2014 - 3:22am #13

Is this possible?

It is software - anything is possible

 

Do not know much scripting,

Learn

 

how could I do this action?

Think about what you want to do, think about how you can do it, think about what techniques you can apply.

Also, view the Dev guide, search the forums and help yourself.

 

N

How to open a web/FB/twitter w/ virtualbutton

April 13, 2014 - 2:27pm #12
Hello guys 
 
I have a huge doubt, I can not use the virtualbutton Vuforia, I'm riding an augmented reality application and need to put buttons when I click to draw a new scenario. 
 
Is this possible? Do not know much scripting, how could I do this action? It would be a great help! 
 
 
 
Thank you

Re: How to open a web/FB/twitter w/ virtualbutton

March 13, 2012 - 5:01pm #11

If you can send your project to

I can take a look at why the button isn't working. Use a file sharing service, you can use this one if you don't have access to another: http://me2u.qualcomm.com

- Kim

Re: How to open a web/FB/twitter w/ virtualbutton

March 13, 2012 - 7:11am #10

yes we have dragged the VirtualButtonEventHandler script to the ImageTargetStone object but it didnt work . We under stand that "The event handler only knows about buttons that are children of target it is attached to, because of the way the Start method is written" but we dont what do we have to modify in the script so that we can have a VirtualButton in another image working .

i have just returned to the 1.0.6 version , when i return to the 1.5 i will send you the logs

best regards

Re: How to open a web/FB/twitter w/ virtualbutton

March 1, 2012 - 4:22pm #9

To get the log, run the DDMS tool that comes with Android. It should be in the tools folder of the Android SDK directory. Clear the log, run the app, then select everything by pressing CTRL-A. Press the save button to save as a file. If it's too big to attach here you can send to

.

To create a new virtual button simply drag the VirtualButton prefab onto the target. Then position it and give it a name. It looks like you did that correctly in your screenshots.

Did you drag the VirtualButtonEventHandler script from the Scripts folder onto the ImageTargetStones object? The VirtualButtonEventHandler that is attached to the Wood target will not react to buttons that are children of the Stones target. The event handler only knows about buttons that are children of target it is attached to, because of the way the Start method is written:

VirtualButtonBehaviour[] vbs = GetComponentsInChildren<VirtualButtonBehaviour>();
for (int i = 0; i < vbs.Length; ++i)
{
    vbs[i].RegisterEventHandler(this);
}

That bit of code only looks for virtual buttons that are children of the target this script is attached to.

- Kim

Re: How to open a web/FB/twitter w/ virtualbutton

March 1, 2012 - 4:57am #8
ksiva wrote:

The VirtualButtonEventHandler script that comes with the samples only registers itself with buttons that are a child of the target it is attached to. Try attaching the script to the stones target as well.

Could you give us the crash log for the 1.5 version running on your Galaxy S? I'd like to help debug that issue.

- Kim

Yes, NP! Can you tell me how I get that log? The app crashes on the phone, not when it build's!

I'm going to try your solution to the other problem, and I tell you!

Thank you!

EDIT: I tried asigning the VirtualButtonEventHandler to the target and nothing happends! What do you mean with "The VirtualButtonEventHandler script that comes with the samples only registers itself with buttons that are a child of the target it is attached to."
Can you explain me as much detailed as possible how to create a virtualbutton on a new imagetarget? How I can send you my unity files?

Re: How to open a web/FB/twitter w/ virtualbutton

February 29, 2012 - 3:19pm #7

The VirtualButtonEventHandler script that comes with the samples only registers itself with buttons that are a child of the target it is attached to. Try attaching the script to the stones target as well.

Could you give us the crash log for the 1.5 version running on your Galaxy S? I'd like to help debug that issue.

- Kim

Re: How to open a web/FB/twitter w/ virtualbutton

February 28, 2012 - 10:31am #6

Im still trying on 1.0.6 version.

I want to create a new imagetarget(with news vb) in the Virtualbutton example. I create a new imagetarget, i assign a new materia from the "dataset", a new model, and i create the virtual button called "mayas"
I added to the code the mayas's case and an action.

Fiat case is a new virtualbutton that I created over the example target and it works perfectly. I'm doing something wrong i guess.

Quote:

switch (vb.VirtualButtonName)

{

case "red":

mTeapot.renderer.material = m_TeapotMaterials[0];

break;

case "blue":

mTeapot.renderer.material = m_TeapotMaterials[1];

break;

case "yellow":

mTeapot.renderer.material = m_TeapotMaterials[2];

break;

case "green":

mTeapot.renderer.material = m_TeapotMaterials[3];

break;

case "fiat":

Application.OpenURL ("http://www.fiat.com/");

break;

case "mayas":

Application.OpenURL ("http://www.wikipedia.com/");

break;

}

Re: How to open a web/FB/twitter w/ virtualbutton

February 28, 2012 - 6:10am #5

Thank you David!

I tried again with 1.5 version, it builds perfectly but when I execute the app in my Samsung Galaxy S (I version) it crashes. Any idea how to solve this problem? With beta version works ok, also with 1.0.6!

Re: How to open a web/FB/twitter w/ virtualbutton

February 28, 2012 - 5:24am #4

Yes - http://unity3d.com/support/documentation/Components/gui-Layout.html

Re: How to open a web/FB/twitter w/ virtualbutton

February 28, 2012 - 5:18am #3

Thank you very much! It is really usefull!

Is also possible with a GUI button? How do I create a Interface in unity??

Re: How to open a web/FB/twitter w/ virtualbutton

February 24, 2012 - 2:45pm #2

hi,
to open a webpage in unity when one of the virtual buttons is pressed simply use Application.OpenURL("http://unity3d.com/") inside one of the cases in the switch in the VirtualButtonEventHandler of the virtual button sample of 1.0.6. that should get you started.
best,
stefan

Log in or register to post comments