Hi is it easy and possibly to link to an image or have an image appear on the screen from a pointer down event?
Can’t quite work it out.
Thanks
Hi is it easy and possibly to link to an image or have an image appear on the screen from a pointer down event?
Can’t quite work it out.
Thanks
Like when you click on the button the image appears? If is this is quite simple.
att, Higão.
Yeah a button that opens an image, in a cool way hopefully, in the scene
Hi
So how do I do this?
Thanks
Hello @technology,
Sorry by the late, it was “holyday” on my country xD.
Well, to do what you want is very simple actually:
1 - Create a controller with two states (you also can do this with a timeline but lets first pratice just the states):
2 - Set your image animations whatever you want, in my case I’ll do just a scale to it, like this:
3 - The green button opens it and the red one closes it;
4 - On the code, drag n’ drop your planes in the script creating two buttons. In your buttons code, drag your states to their related buttons (state “on” on open button, state “off” on close button) like this:
In this way when you click on green the img scale appearing and in the red one the img scale hidding itself.
I think this is all,
att, Higão.
Great will have a look at this later on
Ok done this all but something is up with this -
No, no, again your doin’ wrong with the code blocks. Look:
symbol.nodes.Button_Open.on("pointerup", (e)=>{
symbol.controllers.Button_Controller.elements.On.on("active", ()=>{
//
//
})
Notice that you didn’t close your “active” event block. The right way of this is:
symbol.nodes.Button_Open.on("pointerup", (e)=>{
symbol.controllers.Button_Controller.elements.On.on("active", ()=>{
})
})
Also, I can tip u that when you have an event (active, complete, noactive, playing, or whatever other event can be) it don’t have to be into a button or trigger, you can just let it outside like this:
symbol.nodes.Button_Open.on("pointerup", (e)=>{
})
symbol.controllers.Button_Controller.elements.On.on("active", ()=>{
})
Now finally gettin’ into ur problem, what happend:
You are using an event for your controller. You don’t have to call an event, you have to call the function. So the right way of a state calling is:
symbol.controllers.Button_Controller.elements.Off.active();
Take a look into this article, this might help you:
att, Higão.
Oh I’m sorry - I actually worked it out before you replied. I feel terrible
Hi @technology,
Please take a look at a new thread I have posted. It should help to clear things up.