Discuss Scratch
- 947___
-
39 posts
variables with checkboxes
this feature would be great for settings menus and stuff.
i thought of an idea for variables:
instead of 0 and 1, just a checkbox.
here are some images i made with inspect element:


and instead of just 0 and 1, you could set the values the variable sends when checked, or unchecked

ps: if ppl are wondering what the variable returns in the editor, it's whatever you set it for
for example, 0 and 1
pps: the blocks are like
ppps: it goes unchecked when it's neither of the set values
i thought of an idea for variables:
instead of 0 and 1, just a checkbox.
here are some images i made with inspect element:


and instead of just 0 and 1, you could set the values the variable sends when checked, or unchecked

ps: if ppl are wondering what the variable returns in the editor, it's whatever you set it for
for example, 0 and 1
pps: the blocks are like
set [ v] to (0 v)
change [ v] by (0)
ppps: it goes unchecked when it's neither of the set values
Last edited by 947___ (Aug. 4, 2023 13:31:25)
- Fun_Cupcake_i81
-
1000+ posts
variables with checkboxes
This would be a cool feature to have, and it probably wouldn't be too hard to implement, so I support. Plus, it would make debugging stuff easier.
- wikibro300000
-
1000+ posts
variables with checkboxes
Support, would be useful for settings and easier than making an entire different sprite
- josueart
-
500+ posts
variables with checkboxes
Support, although you can workaround it with a slider.
- wikibro300000
-
1000+ posts
variables with checkboxes
Checkbox looks better Support, although you can workaround it with a slider.
- NotK3ndricAlt
-
1000+ posts
variables with checkboxes
No support. Workaround:
set [var v] to [no]
set [var v] to [yes]
- deweypointjr
-
100+ posts
variables with checkboxes
Support. I have had trouble making settings menus in the past. This would be really useful for that.
- wikibro300000
-
1000+ posts
variables with checkboxes
First you would need to make a sprite and make the code and the more sprites the more confusing the coding is No support. Workaround:set [var v] to [no]
set [var v] to [yes]
- medians
-
1000+ posts
variables with checkboxes
You could also do something like this probably:
when this sprite clickedAlso, maybe this could be done through boolean variables somehow if those are implemented?
if <(var) = [no]> then
set [var v] to [yes]
else
set [var v] to [no]
end
- 947___
-
39 posts
variables with checkboxes
yes, i use that alot You could also do something like this probably:when this sprite clickedAlso, maybe this could be done through boolean variables somehow if those are implemented?
if <(var) = [no]> then
set [var v] to [yes]
else
set [var v] to [no]
end
- Boss_1s
-
100+ posts
variables with checkboxes
support, even though you can use the slider as a workaround, it doesn't look good.
- wikibro300000
-
1000+ posts
variables with checkboxes
You could also do something like this probably:when this sprite clickedAlso, maybe this could be done through boolean variables somehow if those are implemented?
if <(var) = [no]> then
set [var v] to [yes]
else
set [var v] to [no]
end
First you would need to make a sprite and make the code and the more sprites the more confusing the coding is
- qwertycodechamp90411
-
100+ posts
variables with checkboxes
Support! This would make settings way easier.
The only thing I have to add is that I believe it should be a boolean-variable.
'Please note, the variable will report 1 when checked, and 0 when unchecked. You can change these values by right-clicking the variable on-stage'.
I would say make it true/false, not 0/1 for new scratchers, but that would be way too inconvenient (for me, at least).
In a script:
The only thing I have to add is that I believe it should be a boolean-variable.
<checkbox checked?::variables>If it stays a reporter, at least add a pop-up menu similar to the cloud variable message.
'Please note, the variable will report 1 when checked, and 0 when unchecked. You can change these values by right-clicking the variable on-stage'.
I would say make it true/false, not 0/1 for new scratchers, but that would be way too inconvenient (for me, at least).
In a script:
if <checkbox checked?::variables> then
set [difficulty v] to (1)
else
set [difficulty v] to (0)
end
Last edited by qwertycodechamp90411 (Aug. 4, 2023 21:33:01)
- 947___
-
39 posts
variables with checkboxes
Support! This would make settings way easier.
The only thing I have to add is that I believe it should be a boolean-variable.<checkbox checked?::variables>If it stays a reporter, at least add a pop-up menu similar to the cloud variable message.
'Please note, the variable will report 1 when checked, and 0 when unchecked. You can change these values by right-clicking the variable on-stage'.
I would say make it true/false, not 0/1 for new scratchers, but that would be way too inconvenient (for me, at least).
In a script:if <checkbox checked?::variables> then
set [difficulty v] to (1)
else
set [difficulty v] to (0)
end
<checkbox [ v] checked? :: variables>is what you mean
Last edited by 947___ (Aug. 4, 2023 21:38:30)
- qwertycodechamp90411
-
100+ posts
variables with checkboxes
No I meant that the variable name was checkbox lol.Support! This would make settings way easier.
The only thing I have to add is that I believe it should be a boolean-variable.<checkbox checked?::variables>If it stays a reporter, at least add a pop-up menu similar to the cloud variable message.
'Please note, the variable will report 1 when checked, and 0 when unchecked. You can change these values by right-clicking the variable on-stage'.
I would say make it true/false, not 0/1 for new scratchers, but that would be way too inconvenient (for me, at least).
In a script:if <checkbox checked?::variables> then
set [difficulty v] to (1)
else
set [difficulty v] to (0)
end<checkbox [ v] checked? :: variables>is what you mean
Honestly that's better.
- xnousnow
-
9 posts
variables with checkboxes
Yeah, we def need a boolean variable, it's pain to make all the variables
set [boolean variable v] to [0]It would change to:
set [boolean variable v] to [1]
if <(boolean variable) = (0)> then
say [it's false]
end
set [boolean variable v] to <false>Also, that way, <true>/<false> value should be made.
set [boolean variable v] to <true>
if <not<boolean variable>> then
say [it's false]
end
- 947___
-
39 posts
variables with checkboxes
Yeah, we def need a boolean variable, it's pain to make all the variablesset [boolean variable v] to [0]It would change to:
set [boolean variable v] to [1]
if <(boolean variable) = (0)> then
say [it's false]
endset [boolean variable v] to <false>Also, that way, <true>/<false> value should be made.
set [boolean variable v] to <true>
if <not<boolean variable>> then
say [it's false]
end
it could just be Support! This would make settings way easier.
The only thing I have to add is that I believe it should be a boolean-variable.<checkbox checked?::variables>If it stays a reporter, at least add a pop-up menu similar to the cloud variable message.
'Please note, the variable will report 1 when checked, and 0 when unchecked. You can change these values by right-clicking the variable on-stage'.
I would say make it true/false, not 0/1 for new scratchers, but that would be way too inconvenient (for me, at least).
In a script:if <checkbox checked?::variables> then
set [difficulty v] to (1)
else
set [difficulty v] to (0)
end
<(my variable) = (1)>but maybe once we get custom reporters and booleans
define () // pretend there's no block shape there
return (value::custom)::custom
define <>
return (value::custom)::custom
Last edited by 947___ (Aug. 5, 2023 01:24:16)