Revision as of 03:17, 17 February 2018 by VoxBot (talk | contribs) (top: template removal and cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Hide Variable ()
2.0 Hide Variable ().png
Category Variables
Type Stack
Introduced in 1.3

The Hide Variable () block is a Variables block and a Stack block. The block hides the specified variable's Stage monitor.

Example Uses

In projects that use variables' Stage monitors to display things, the displays may have to hide and show at times; this can be done with the Show Variable ().

  • Hiding a slider when a value is not editable
when this sprite clicked //a button to lock-in or open the value editing
if <(editable) = [yes]> then
hide variable [width v]
set [editable v] to [no]
show variable [width v]
set [editable v] to [yes]
  • Hiding the score at the end of a game
when gf clicked
set [points v] to (0)
set [status v] to [running]
show variable [points v]
repeat until <not <(status) = [running]>>
go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
set [lastTime v] to (timer)
wait until <<((timer) - (lastTime)) > (.3)> or <<mouse down> and <touching [mouse-pointer v]?>>>
if <<mouse down> and <touching [mouse-pointer v]?>> then
change [points v] by (1)
play sound [pop v]
if <(points) = [10]> then
set [status v] to [win]
if <(timer) > (10)> then
set [status v] to [lose]
broadcast (status)
wait (2) secs
hide variable [points v]
  • When the variable has no use anymore
when I receive [game end v]
hide variable [score v]
if <(health) < (previous health)> then
set [readout v] to (([you lost ] + (health lost)) + [ health])
show variable [readout v]
wait (0.5) secs
hide variable [readout v]

See Also