Hide Variable () | |
hide variable [ v] | |
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] else 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] end end if <(timer) > (10)> then set [status v] to [lose] end end 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]
- displaying messages in One Sprite One Script Projects
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] end
See Also
() • Set () To () • Change () By () • Show Variable () • Hide Variable () • See also: List BlocksMore blocks...
|