Director Class

Posted by ricardorauber, Posted on October 7, 2010, Last updated July 1, 2011

41 votes

Hello everybody! I'm so pleased to share with you my Director class for control scenes with or without transitions!

Version 1.3

New features, check this out!

rauberlabs.blogspot.com/2011/07/director-class-13.html

Video Tutorial: rauberlabs.blogspot.com/2010/12/director-video-tutorial.html

ATTENTION - All questions will now be answered at Director's sub-forum: developer.anscamobile.com/forums/director-class

spacer

It's very easy to use, just import it, add the groups to the main group and it's done! This zip file contains an example with all the transitions in this version. Also, there's a template.lua file that you can use in your own projects.

Feel free to ask anything about it at the forum or by e-mail, I'll be very pleased to ask your answers!

- Version 1.3:
https://bitbucket.org/ricardorauber/corona/downloads/director_by_ricardo...

- Version 1.2:
bitbucket.org/ricardorauber/corona/downloads/director_by_ricardo_...

- Version 1.1:
bitbucket.org/ricardorauber/corona/downloads/director_by_ricardo_...

- Version 1.0:
bitbucket.org/ricardorauber/corona/downloads/director_by_ricardo_...

See ya!

More Information: rauberlabs.blogspot.com/
twitter.com/rauberlabs

Compatibility: 
Corona 2.0

  • Type:
    • Utilities
  • Tags:
    • director,
    • scene
  • Login or register to post comments

Replies

Posted on Wed, 2010-10-06 19:59
#1
LiveToCollect
spacer Offline
Joined: 3 Feb 2010

Well done, Ricardo. I like what I see so far and intend to put this to use in my next project. I will let you know how it goes when I am done. Thank you for sharing your code!

Top
  • Login or register to post comments
  • 0 votes
Posted on Thu, 2010-10-07 16:38
#2

spacer

Ansca Staff

Tim
spacer Offline
Joined: 12 Aug 2010

Very nice, thanks for sharing!

Top
  • Login or register to post comments
  • 0 votes
Posted on Sat, 2010-10-09 05:20
#3
jonbeebe
spacer Offline
Joined: 26 Jul 2010

This is amazing, and admittedly, much better than what I was using. I'll definitely use this class, thanks for sharing Ricardo!

Top
  • Login or register to post comments
  • 0 votes
Posted on Sun, 2010-10-10 05:00
#4
MBD
spacer Offline
Joined: 14 Sep 2010

Perfect, perfect, perfect!
Great job!!

Top
  • Login or register to post comments
  • 0 votes
Posted on Tue, 2010-10-12 23:35
#5
XenonBL
spacer Offline
Joined: 24 Sep 2010

I wired this into my project and it works great! Thank you for sharing it, Ricardo.

Top
  • Login or register to post comments
  • 0 votes
Posted on Wed, 2010-10-13 01:22
#6
dario
spacer Offline
Joined: 18 Aug 2010

I love it. Thanx a lot :)

Top
  • Login or register to post comments
  • 0 votes
Posted on Wed, 2010-10-13 20:17
#7
awesomeware14
spacer Offline
Joined: 3 Oct 2009

You asked for additional code changes so here are two effects I added to mine:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
        -----------------------------------
        -- EFFECT: Move From Top
        -----------------------------------
        
        elseif effect == "moveFromTop" then
        
                nextView.x = 0
                nextView.y = display.contentWidth*-1
                --
                loadScene (nextScene)
                --
                showFx = transition.to ( nextView, { y=0, time=fxTime } )
                showFx = transition.to ( currentView, { y=display.contentHeight, time=fxTime } )
                --
                timer.performWithDelay( fxTime, fxEnded )

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
        -----------------------------------
        -- EFFECT: Move From Bottom
        -----------------------------------
        
        elseif effect == "moveFromBottom" then
                        
                nextView.x = 0
                nextView.y = display.contentHeight
                --
                loadScene (nextScene)
                --
                showFx = transition.to ( nextView, { y=0, time=fxTime } )
                showFx = transition.to ( currentView, { y=display.contentHeight*-1, time=fxTime } )
                --
                timer.performWithDelay( fxTime, fxEnded )

Top
  • Login or register to post comments
  • 0 votes
Posted on Thu, 2010-10-14 14:41
#8
Rob2
spacer Offline
Joined: 14 Apr 2010

Fantastic

Top
  • Login or register to post comments
  • 0 votes
Posted on Thu, 2010-10-21 10:18
#9
reddotinc
spacer Offline
Joined: 20 Jun 2010

@awesomeware14 your move from top code creates doesn't transition smoothly, so I fixed it :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
         -----------------------------------
        -- EFFECT: Move From Top
        -----------------------------------
        
        elseif effect == "moveFromTop" then
        
                nextView.x = 0
                nextView.y = display.contentHeight*-1
                --
                loadScene (nextScene)
                --
                showFx = transition.to ( nextView, { y=0, time=fxTime } )
                showFx = transition.to ( currentView, { y=display.contentHeight, time=fxTime } )
                --
                timer.performWithDelay( fxTime, fxEnded )

// red.

Top
  • Login or register to post comments
  • 0 votes
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.