Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to Code to open and close another window
- 50Fingers
-
59 posts
How to Code to open and close another window
Hi All,
I would like to code a sprite that open up a window and when the user clicks on it again, the window closes.
Can anyone help?
I would like to code a sprite that open up a window and when the user clicks on it again, the window closes.
Can anyone help?
- Uniquename1
-
100+ posts
How to Code to open and close another window
It wouldn't be an actual window on your computer but you can show and hide a sprite that looks like a box/ window within the scratch viewing window.
You could either have another sprite as an icon to click on to open said ‘window’ or press a keyboard button to open it. Specific details depend on what you want on it and such but basically hide and show a sprite. And use that sprite or multiple sprites as your window.
It would be multiple sprites if for example you had more buttons and such in the window.
You could either have another sprite as an icon to click on to open said ‘window’ or press a keyboard button to open it. Specific details depend on what you want on it and such but basically hide and show a sprite. And use that sprite or multiple sprites as your window.
It would be multiple sprites if for example you had more buttons and such in the window.
Last edited by Uniquename1 (Aug. 10, 2017 00:52:30)
- MineLox92Videos
-
100+ posts
How to Code to open and close another window
So you have your window (In the game), and you have a button:
Last edited by MineLox92Videos (Aug. 10, 2017 00:53:03)
- 50Fingers
-
59 posts
How to Code to open and close another window
So you have your window (In the game), and you have a button:
Hi MineLox92Videos!
Thanks for reading my post and sharing the code.
I have tried and applied on my project which is about a business simulation game aka theme park tycoon.
However, how do I code to make the window appears after applying the first script to a button which user needs to click on before the window appears?
My Project: https://scratch.mit.edu/projects/170469472/
Last edited by 50Fingers (Aug. 10, 2017 01:21:23)
- MineLox92Videos
-
100+ posts
How to Code to open and close another window
Wait, the user has to type the code to open it?So you have your window (In the game), and you have a button:
Hi MineLox92Videos!
Thanks for reading my post and sharing the code.
I have tried and applied on my project which is about a business simulation game aka theme park tycoon.
However, how do I code to make the window appears after applying the first script to a button which user needs to click on before the window appears?
My Project: https://scratch.mit.edu/projects/170469472/
- MineLox92Videos
-
100+ posts
How to Code to open and close another window
Never mind, you have to set the variable to false, once, manually.
- 50Fingers
-
59 posts
How to Code to open and close another window
Never mind, you have to set the variable to false, once, manually.
The user need not type any code to open the button. They just need to click on the button to open a window.
If you have seen my project, I only have one category in this tycoon game. The category is called scenery. Users are to click on Scenery to open up a menu of sprites that they can place on their theme park ground.
I don't quite understand how that script works in order to allow the user to click on the button to open a window and then click on it again to close the window. Appreciate if you could explain how did you form this script?
Last edited by 50Fingers (Aug. 10, 2017 01:53:56)
- MineLox92Videos
-
100+ posts
How to Code to open and close another window
Also, I forgot to mention have this:Never mind, you have to set the variable to false, once, manually.
The user need not type any code to open the button. They just need to click on the button to open a window.
If you have seen my project, I only have one category in this tycoon game. The category is called scenery. Users are to click on Scenery to open up a menu of sprites that they can place on their theme park ground.
I don't quite understand how that script works in order to allow the user to click on the button to open a window and then click on it again to close the window. Appreciate if you could explain how did you form this script?
Last edited by MineLox92Videos (Aug. 10, 2017 02:54:32)
- 50Fingers
-
59 posts
How to Code to open and close another window
Also, I forgot to mention have this:Never mind, you have to set the variable to false, once, manually.
The user need not type any code to open the button. They just need to click on the button to open a window.
If you have seen my project, I only have one category in this tycoon game. The category is called scenery. Users are to click on Scenery to open up a menu of sprites that they can place on their theme park ground.
I don't quite understand how that script works in order to allow the user to click on the button to open a window and then click on it again to close the window. Appreciate if you could explain how did you form this script?
Thank you! I manage to make the idea I wanted work somehow. However I am not sure where should I always place those two scripts at?
- MineLox92Videos
-
100+ posts
How to Code to open and close another window
Anywhere.Also, I forgot to mention have this:Never mind, you have to set the variable to false, once, manually.
The user need not type any code to open the button. They just need to click on the button to open a window.
If you have seen my project, I only have one category in this tycoon game. The category is called scenery. Users are to click on Scenery to open up a menu of sprites that they can place on their theme park ground.
I don't quite understand how that script works in order to allow the user to click on the button to open a window and then click on it again to close the window. Appreciate if you could explain how did you form this script?
Thank you! I manage to make the idea I wanted work somehow. However I am not sure where should I always place those two scripts at?
- 50Fingers
-
59 posts
How to Code to open and close another window
Thanks for your reply!
I have applied the scripts to the sprites which I want the open and close window interaction to happen.
I have a sprite which is called News. I want the user to click on it and the daily events and weather forecast in the news would pick randomly. I could not make make it appear and hide the same time when the News sprite.
Could you help?
My Project: https://scratch.mit.edu/projects/170469472/
I have applied the scripts to the sprites which I want the open and close window interaction to happen.
I have a sprite which is called News. I want the user to click on it and the daily events and weather forecast in the news would pick randomly. I could not make make it appear and hide the same time when the News sprite.
Could you help?
My Project: https://scratch.mit.edu/projects/170469472/
Last edited by 50Fingers (Aug. 10, 2017 23:47:43)
- MineLox92Videos
-
100+ posts
How to Code to open and close another window
I tried and I'm lost. Sorry Thanks for your reply!
I have applied the scripts to the sprites which I want the open and close window interaction to happen.
I have a sprite which is called News. I want the user to click on it and the daily events and weather forecast in the news would pick randomly. I could not make make it appear and hide the same time when the News sprite.
Could you help?
My Project: https://scratch.mit.edu/projects/170469472/

- deck26
-
1000+ posts
How to Code to open and close another window
No need to necropost to say so though. This helped alot
- RAYBOI123451
-
1 post
How to Code to open and close another window
just how do I open another window, but not in scratch, but on the computer?
- Discussion Forums
- » Help with Scripts
-
» How to Code to open and close another window