How do I navigate between pages

0 favourites
  • 7 posts
From the Asset Store
Template for making an interactive book or a simple story book
  • Hello,

    I am trying to create an interactive book and cannot seem to get the page navigation working properly. I have two sprites (one for next and one for back) and want the pages to change when the user touches them. This is what i have so far...

    I have attached the event sheet.

    The Global Variable "CurrentPage" does change when the sprite is touched (checked in debug mode) but the Layout does not. I have also tried using "Layout"&CurrentPage but this behaves the same.

    Any advice?

    Thanks.

  • You should navigate to a layout by name, but we can't see those without the capx. What are they called? "Layout 1", "Layout 2"?

    Edit: Make sure you have the space between 'Layout' and the number.

    Suggestions. You don't need the check for CurrentPage in event 6 and 7, and adding System:Once while true to events 2-5 would advisable.

  • Hi Codah,

    Yes, they are named Layout1, Layout2...

  • Hi Codah,

    Yes, they are named Layout1, Layout2...

    Without a space..?

  • OK... I found the problem, i was missing a space. so "Layout"&CurrentPage should have been "Layout "&CurrentPage.

    The reason i check for CurrentPage in events 6&7 is that even though the sprite disappears (invisible) on the last page, clicking on the empty space still increases the CurrentPage value. Not sure if it makes a difference but I prefer to be safe.

    Thanks for your help.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Lol

  • I have a new issue now... the pages change fine, but when going backwards (i.e. pg 5,4,3,2,1) the forward button disappears on pg 2 and both disappear on page 1...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)