[Solved] If scrolling is true, buttons cannot be pressed.
As_Of_Latte
Member, BASIC Posts: 343
I have a scene that is capable of scrolling up and down. I followed Gamesalad Guru's "Scroll Camera" tutorial on Youtube, for guidance;
I have actors (buttons) that when pressed purchase items for the game, that scroll within this scene. Here's what I am trying to figure out:
When scrolling is in motion, buttons cannot be pressed. Once scrolling has stopped motion, buttons can be pressed.
Anyone know how to accomplish this? Any help is appreciated .
Comments
You need to click on the scene tab, go to layers, and make another layer on top that is not scroll able, place the buttons on that layer. The bottom left of the scene will contain the area that doesn't scroll with the camera, place all the nonmoving actors in that part of the scene and move them into a nonscrolling layer
www.rossmanbrosgames.com
@RossmanBrothersGames Thanks for the quick reply! I have tried what you have mentioned but I am a little confused...
I would like my button actors to still scroll up and down with the scene. I am not trying to stop any actors from scrolling...
I would just like my buttons to not be "clickable" while scrolling is in motion.
Hope this makes sense
Ah I see. If you are not doing what I said before you will still want to do it for the buttons. Having the buttons on a nonscrolling layer keep them in place on the screen as the camera moves. So if your scene scrolls up, the buttons stay in place on the screen so you don't need to put behaviors in them to keep them scrolling with the screen.
As for not being able to touch them when they move. Make a game attribute, make it a boolean call it scrolling. In the actor controling the camera when the camera is moving change game.scrolling to true otherwise change to false
In the button actor make a rule,
if game.scrolling is true AND if touch is pressed
then.....
this will only let the button be touched and do something if scrolling is true.
www.rossmanbrosgames.com
@RossmanBrothersGames Awesome dude, thank you so much! This worked