See trough black actor that covers whole screen
Hello guys!
I think this one is very easy but I just seem to can't figure it out.
I have scene with few buttons (actors) that can be pressed and when they are pressed they send you to their scenes.
Also there is one button lets call him button1 that (when pressed) spawns see trough black actor that covers whole screen and all other buttons are now under that see trough black actor.
So here comes my problem:
I have this situation - button1 is pressed -> spawns see trough black actor that covers whole screen -> all other buttons that are under see trough black actor can still be pressed
I want this - button1 is pressed -> spawns see trough black actor that covers whole screen -> all other buttons that are under see trough black actor CAN'T BE PRESSED ANYMORE.
Please help me out guys!
Best Answer
-
mhedges Raised on VCS Posts: 634
@RedCubeGames , I edited my post, please reread (I'm reading on the iPhone). Regards.
Answers
Check your layers to make sure whatever button1 spawns is above the other things in your layering.
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
Actors that are covered by other actors are still active in the scene, even if you can't see them. One way to accomplish what you want is to change the X and Y locations (to an area off screen) of the buttons once the black area is spawned and then change the buttons back to the correct X and Y locations when the black area is removed.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@Summation I did that but but other buttons can still be pressed.
@jamie_c But I need them to stay at their positions because black actor that is spawned when I press button1 is see trough. Is there another way to make other buttons who are under "see trough black actor" inactive?
Create a boolean so that the buttons become inactive when the black actor appears.
When black actor is spawned, change attribute buttons inactive to true. In the buttons, when attribute buttons inactive = false, then do whatever behavior. In the large actor, just before you destroy it, change buttons inactive back to false.
My Blog / App Store / Google Play
@mhedges
Ok now we are talking, I like that solution!
but please explain me more detailed what do i need to do