(Redirected from Background Number (block))

Archive.png This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective.
The correct title of this article is Backdrop # (block). The Scratch Wiki uses this different title because of technical restrictions.
This article is about the block in Scratch 2.0. For the block in Scratch 3.0, see Backdrop () (block). For more information on the value this block reports, see Backdrop Number (value).
Backdrop #
(backdrop #::looks)
Category Looks
Type Reporter
Introduced in 2.0
Removed in 3.0

The Backdrop # block was a looks block and a reporter block. This block returned 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.

The block was replaced with Backdrop () in Scratch 3.0, which combined this block and the backdrop name block into one block with the dropdown options "number" and "name".

History

Prior to Scratch 2.0, this block was called Background #. Unlike the other backdrop blocks,[citation needed] 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.

Example Uses

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 green flag clicked
wait until <(backdrop #) = (6)>
stop [all v]
  • Displaying the current backdrop number.
say (join [The current backdrop is: ] (backdrop #))
  • Setting a variable to the backdrop scene.
set [level v] to (backdrop #)

Workaround

Main article: List of Block Workarounds

This block can be replicated with the block that replaced it:

(backdrop [number v])

It can also be replicated using the () of () sensing block:

([backdrop # v] of [Stage v])

This workaround is useful whenever a sprite needs to detect the current backdrop number as opposed to the Stage.

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.