TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
What's the best way to make a switching button?
Pages:
1
What's the best way to make a switching button?
ozz
Posts: 575
November 18, 2014, 02:45:03 pm
I have a button I want to use for duel switching, between page 0 and Page 1, but the snippet you see bellow doesn't work all that well. What's an effective way to do this?
z26
Posts: 21
November 18, 2014, 05:15:01 pm
I think a bit more context would be helpful.
ozz
Posts: 575
November 18, 2014, 05:33:01 pm
Sure, I have a button in a scene. I want it to switch to Page 0 when it's on Page 1 and to Page 0 when it's on Page 1. Basically a button that sets a number variable to X if it's Y or Y if it's X.
playtheHnote
Posts: 395
November 18, 2014, 05:36:24 pm
put a stop block in the if check part and try (below the timer)
Check out my instrumental rock album "Hail to the Chosen One" at:
https://soundcloud.com/play-the-h-note
Visit my facebook page @
https://www.facebook.com/justin.shellhorn.1
"Sound King" now available at the forge see
http://community.stencyl.com/index.php/topic,35672.0.html
for more info!
HarryK
Posts: 32
November 18, 2014, 05:37:14 pm
Maybe add "click to change scene??"
playtheHnote
Posts: 395
November 18, 2014, 05:39:19 pm
And hang on while i figure out whats going on in your game. What is turning pages an actor?
Check out my instrumental rock album "Hail to the Chosen One" at:
https://soundcloud.com/play-the-h-note
Visit my facebook page @
https://www.facebook.com/justin.shellhorn.1
"Sound King" now available at the forge see
http://community.stencyl.com/index.php/topic,35672.0.html
for more info!
ozz
Posts: 575
November 18, 2014, 05:43:17 pm
End didn't change anything, I've never been able to use it effectively.
It's within the same scene.
It's a scene using an actor.
letmethink
Posts: 2545
November 19, 2014, 12:16:21 am
What doesn't work with that snippet? I don't think you need the do after 0.5 seconds wrapper around the block. Try removing it.
~Letmethink
Innes
Posts: 1960
November 19, 2014, 02:43:40 am
Using two [if] blocks for a toggle is inefficient and prone to errors. Have a look at the following link which explains how to refactor your code to improve toggling.
www.thestencylblog.com/blog/refactoring-code-and-avoiding-errors-in-stencyl
« Last Edit: November 16, 2020, 11:09:52 pm by Justin »
Visit
www.TheStencylBook.com
- the only published book for learning Stencyl.
Pages:
1