(Redirected from Background Number (block))
- The correct title of this article is Backdrop # (block). The Scratch Wiki uses this different title because of technical restrictions.
|This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective.|
- This article is about the block. For more information on the value this block reports, see Backdrop Number (value).
The Backdrop # block was a Looks block and a reporter block. This block held the current backdrop number. It appeared only in the Stage's block palette; however, the Backdrop Name block appeared in both the stage and sprites.
This block can be displayed as a stage monitor.
Prior to Scratch 2.0, this block was called Background #. Unlike the other backdrop blocks, only its name was changed, not its function. During the development of Scratch 2.0, this block was available to both the stage and sprites.
As this block holds the backdrop number of the Stage, it is used when something must happen if the Stage is at a specific backdrop. Some more common uses are:
- Stopping the project once the Stage reaches the backdrop for the end of the project. This is helpful because it will automatically stop the project when that backdrop is reached.
when gf clicked wait until <(backdrop #) = (6)> stop [all v]
- Checking what the current backdrop is
say (join [The current backdrop is: ] (backdrop #))
- Setting a variable to the backdrop scene
set [level v] to (backdrop #)
- Main article: List of Block Workarounds
This block can simply be replicated with the following code
([backdrop # v] of [Stage v])
This workaround is useful whenever a sprite needs to detect the current backdrop number.
- Backdrop Name
- Costume # (block)
- Costume # (value)
- Next Backdrop
- Switch Backdrop to ()
- Switch Backdrop to () and Wait
- When Backdrop Switches to ()
Say () for () Secs • Say () • Think () for () Secs • Think () • Switch Costume to () • Next Costume • Switch Backdrop to () Next Backdrop • Change Size by () • Set Size to ()% • Change () Effect by () • Set () Effect to () • Clear Graphic Effects • Show • Hide • Go to () Layer • Go () () Layers • Costume # • Backdrop Number • Size
|For the Stage|