What's the best way to set up this stack? (Hidden pages)

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Weaksafety
Posts: 17
Joined: Mon Aug 12, 2013 5:20 pm

What's the best way to set up this stack? (Hidden pages)

Post by Weaksafety » Wed Jun 04, 2014 10:28 pm

Hi again,

I'm trying to find the best way to setup a new project. Since I'm really new to programming I'd love to have a methodological point of view from your experience :)
Basically, the project will be a digital book for android and ipad. It's going to have more than 100 pages, so readability is crucial.

I'd like to create a navigation system so that if I swipe, i can navigate directly to the previous/next chapter index, instead of having to scroll through all the cards that will compose that chapter.

So for example the structure will be something like:

Code: Select all

Chapter 1 Home
   > CH1 - Page1
   > CH1 - Page2
   > CH1 - Page3
Chapter 2 Home
   > CH2 - Page 1
   > CH2 - Page n..
Chapter n Home (etc)
  > ..
My Idea so far would be this:
- Chapter Homes will each be a page in the Mainstack
- Chapter Sub-Pages will be contained in a dedicated sub-stack that will open in the main window (i.e. go stack "Substack1" in window stack "Mainstack") and will have controls to return to the chapter home.

This way, the user could have a simplified navigation without having to scroll through all the pages, and dedicated 'go to' functions will allow to get back to the main stack to continue navigation.

What do you think? I'm totally unexperienced in this, so maybe there's an easier way I'm not considering at all..

Thanks!! :D

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: What's the best way to set up this stack? (Hidden pages)

Post by Simon » Wed Jun 04, 2014 11:26 pm

Hi,
I think you should look at examples of how this has been done in the past.
Here on my Kindle a swipe is used to turn pages and a double tap brings up a menu for going to chapters.

But more to expand your thinking...
Many people do think that they need a single card for each page and that just is a mess. Adding words to a single page may mean you have to bump every single card (yuck).
Suppose you just used 1 or 2 cards, put all the text into a custom property and said "give me the next 20 lines" every page turn. How easy would that be to manage? You could just dump any text in so you'd have a platform for many books.

If you don't understand custom properties no problem, they are really easy.

Want more? Just ask.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Weaksafety
Posts: 17
Joined: Mon Aug 12, 2013 5:20 pm

Re: What's the best way to set up this stack? (Hidden pages)

Post by Weaksafety » Thu Jun 05, 2014 10:48 am

Thanks Simon.
Let me say that I appreciate immensely your approach of giving hints instead of a solution, that's what's needed to get people thinking and learning.

Your suggestion of using custom properties is great, however I won't be able to use it since this project will be more of a brochure than a book, like 90% made of images, of various sizes and positions, imported as controls. So I fear having a lot of pages will be a necessity in this case.
I don't know if that stems other thoughts from you on the matter..

I would have a few more questions on navigation, that do not match exactly the title of this thread. Can I ask them here or, for the sake of keeping things clean for others, should I open another thread?

Thanks a lot again
Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: What's the best way to set up this stack? (Hidden pages)

Post by Simon » Thu Jun 05, 2014 12:05 pm

Hi Michael,
I think you should just change the title of the post.
"Best" is impossible to define because there are so many ways of doing things in liveCode. Maybe just "Hints on how to build an ebook".

Custom properties can hold picture data

Code: Select all

set the cMyProp of this stack to the imageData of image 1
set the imageData of image 2 to the cMyProp of this stack
Now you are into measuring pixels for each card.

There is a lot more to be said on implementing this method. Fun to play around with.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”