Accessing Button Transitions

Hi there!

Been using your director class to make a menu with buttons just like you (Ricardo) have on your youtube video. I’ve got my buttons changing scenes, and now I want to access those transitions such as movefromright, fade, etc. How do I go about doing that? Right now the buttons on my menu have this code:

local function pressone (event) if event.phase=="ended" then director:changeScene ("one") end end onebutton:addEventListener("touch",pressone)

Any help (from anyone) would be appreciated!

Thank you so much!!!
[import]uid: 20687 topic_id: 5588 reply_id: 305588[/import]

Hi chrisbryantguitar,

You just need to put the effect name in the second parameter of the function, like this:

local function pressone (event)  
 if event.phase=="ended" then  
 director:changeScene ("one","moveFromRight")  
 end  
end  
onebutton:addEventListener("touch",pressone)  

To see all the transitions, just take a look at the function changeScene inside director.lua. [import]uid: 8556 topic_id: 5588 reply_id: 18993[/import]

Thanks Ricardo!

So I’ve got got the code in place, thank you for explaining that!

Is there anything else I need to do? Any functions that need to be written? In the simulator and as a device build I’m still not seeing the transitions.

You rock man. Keep up the good work! [import]uid: 20687 topic_id: 5588 reply_id: 19077[/import]

If you aren’t seeing the transitions then something is wrong. Please check if the files are at the same folder.

If you put timers, you have to cancel them before change scenes, so the best to do is make a clean() function with the commands. [import]uid: 8556 topic_id: 5588 reply_id: 19231[/import]