Discuss Scratch

smisamul6
Scratcher
100+ posts

Win11 Emulator help

I need help with my script for my Windows 11 Emulator.
When I click the settings icon, it opens up a window. But when I click it again, it zooms in instead of hiding the window. Could somebody please help me with the code to hide the window. Thanks in advance!
legendary34678
Scratcher
1000+ posts

Win11 Emulator help

I don't know why you expected that clicking the settings button would make it hide itself if you didn't program it to work that way.

Anyways, here's what I'd do:

1. Create a variable and call it whatever you'd like. I'll call it “In Settings?” It'll start at 0 which will represent False.

set [In Settings? v] to [0]

2. Whenever SettingsWindow receives the Settings broadcast message, it'll run a different script depending on the value of In Settings?

when I receive [Settings v]
if <(In Settings?) = [0]> then //Not currently in settings
... //Settings will appear
else
... //Settings will disappear
end

3. For the script to work, In Settings? has to have the right value at the right time. So, you can change the variable within the if else loop like so:

when I receive [Settings v]
if <(In Settings?) = [0]> then //Not currently in settings
set [In Settings? v] to [1] //It is TRUE that we are in the settings
... //Settings will appear
else
set [In Settings? v] to [0] //It is FALSE that we are in the settings
... //Settings will disappear
end

Hope this helped, and feel free to ask any questions.
smisamul6
Scratcher
100+ posts

Win11 Emulator help

legendary34678 wrote:

I don't know why you expected that clicking the settings button would make it hide itself if you didn't program it to work that way.

Anyways, here's what I'd do:

1. Create a variable and call it whatever you'd like. I'll call it “In Settings?” It'll start at 0 which will represent False.

set [In Settings? v] to [0]

2. Whenever SettingsWindow receives the Settings broadcast message, it'll run a different script depending on the value of In Settings?

when I receive [Settings v]
if <(In Settings?) = [0]> then //Not currently in settings
... //Settings will appear
else
... //Settings will disappear
end

3. For the script to work, In Settings? has to have the right value at the right time. So, you can change the variable within the if else loop like so:

when I receive [Settings v]
if <(In Settings?) = [0]> then //Not currently in settings
set [In Settings? v] to [1] //It is TRUE that we are in the settings
... //Settings will appear
else
set [In Settings? v] to [0] //It is FALSE that we are in the settings
... //Settings will disappear
end

Hope this helped, and feel free to ask any questions.
Thanks so much! It worked!

Powered by DjangoBB