Cards, Cards and More Cards - adding more screens (levels, cards) We started out with a mainstack. Remember, LiveCode uses the idea of a stack of cards where each card is a different screen. Each card can be a new page in your book, a new level in your game or a new screen for your program. It can be many things. To create a new card, do one of the following:
Name the card: On the LiveCode Menubar, click on "Object" , then click on "Card Inspector" give the card a name like "Main" Right click on the card and select "Card Inspector" give the card a name like "Main"
Add a button with the following code on it
3. Add a new card: On the LiveCode Menubar, click "Object" then click on "New Card" Name it "level2" (see step 2 above) while you are in the Property Inspector, go to "Colors and Patterns" and make it a color so that we can tell it from the first card Add a button with the following code on it
You should now be able to go back and forth between the cards Alternate Way to move between cards: You can also refer to the cards as "next" and "prev" or "previous" Change the buttons to read::
Aton to:
to go to the previous card (with visual effects) Another way is to name the cards and use the names in the go to's. If you name the cards "home" and "card 2", you could do it this way: on mouseUp to go to the next card which you named "card 2" (with visual effects)
How-To: To add a new card: On the top menubar, click on "Object", "Add new card" To switch between cards: Open the "Project Browser" - on the menubar: click on "Tools", "Project Browser" Expand your project by clicking on the little triangles Click on either card to go to it.
on preOpenStackif the environment is "mobile" thenset the fullscreenmode of me to "exactFit"end ifend preOpenStack
|
Home >