Next and Back buttons

WarlockWarlock Member Posts: 66
edited November -1 in Working with GS (Mac)
Hi guys,

I'm jamming hard on my first project. I'm working on an interactive book. I was wondering if someone could please tell me how to code a next and back button so people can turn pages. Any help is greatly appreciated. I hope to load some example pages soon:)

Warlock

Comments

  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    First, each "page" would need to be on a different scene. Create 2 actors, one for each button. Add the following logic in both.

    `
    Rule: When touch is pressed
    --Change Scene to Scene.????
    `
    The Change Scene behavior gives you the following options I believe:
    -Initial Scene
    -Next
    -Previous
    -----------
    -List of specific scenes by name.

    http://gamesalad.com/wiki/behaviors_reference:change_scene
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    I made a 16 page book with 16 images.

    I have 3 actors.

    Images
    Forward
    Backward

    -----------------
    Images:

    If game.page = 0
    change image to 0.png

    otherwise
    ...
    if game.page = 16
    change image to 16.png

    -----------------
    Forward:
    alpha = 0

    if game.page < 16
    change attribute self.color.alpha to 1
    Actor receives touch pressed
    change attribute game.page to game.page+1

    otherwise

    if attribute game.page = 16
    change attribute self.color.alpha to 0

    The back button the same, just into the other direction.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    Hmm, that's different (read: better) than my first inclination...

    Welcome back hunn?
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Thx :-)
    Still not really wanting back :-)

    I just wanted to help, because it is simple and I already did it, so I thought, I don't let the poor man in the dark. :-)

    It is not good for big books (many images) because you have to nest everything into eachother and with 16 pages it was already a horror :-)

    Don't use it for too many pages.
  • WarlockWarlock Member Posts: 66
    Thanks everyone! I appreciate it. I'll post some pics of the pages soon:)

    Warlock
Sign In or Register to comment.