(Remove {{unreleased}})
(Merged content from Switch to Background ().)
Line 1: Line 1:
 
 
{{block
 
{{block
 
| name      = Switch Backdrop to ()
 
| name      = Switch Backdrop to ()
Line 7: Line 6:
 
| added      = 2.0
 
| added      = 2.0
 
}}
 
}}
The '''Switch Backdrop to ()''' [[Blocks|block]] is a [[Looks Blocks|Looks block]] and a [[Stack Block|Stack block]].
+
The '''Switch Backdrop to ()''' [[Blocks|block]] is a [[Looks Blocks|Looks block]] and a [[Stack Block|Stack block]]. The block changes the [[Stage|Stage's]] [[backdrop]] to the specified one.
 +
 
 +
This block is a commonly used block; it is used whenever the Stage must switch to a specific backdrop (instead of the [[Next Backdrop (block)|Next Backdrop]] block, which does not always give the same backdrop). A [[variable]] (or any [[Reporter Blocks|reporter]]) containing a number or the name of a backdrop can be dropped in.
 +
 
 +
A [[sprite]]'s version is [[Switch to Costume ()]].
 +
 
 +
==History==
 +
Prior to [[Scratch 2.0]], this block was called Switch to Background () and didn't fire an event upon running. During 2.0 development, this block was also called Switch to Scene ().
 +
 
 +
==Workaround==
 +
{{main|List of Block Workarounds}}
 +
This block can be replicated with the following code:
  
Prior to [[Scratch 2.0]], this block was called [[Switch to Background ()]] and didn't fire an event upon running.
+
<scratchblocks>
 +
repeat until <(wanted backdrop #) = (backdrop #)>
 +
  next backdrop
 +
end
 +
</scratchblocks>
 +
However, it is often much faster to use the original block.
 +
 
 +
It can also be replicated with a sprite that [[stamps]] the new background.
  
 
==Example Uses==
 
==Example Uses==
 +
Because of its simplicity, this block does not have a specific list of main uses {{-}} it is simply used to change the background of the Stage. It can be used in animations, games, simulations {{-}} anything that requires changes between backgrounds.
 +
 +
Some common uses are as follows:
 
*Starting a level
 
*Starting a level
 
<scratchblocks>switch backdrop to [level1 v]</scratchblocks>
 
<scratchblocks>switch backdrop to [level1 v]</scratchblocks>
Line 24: Line 44:
 
*Simply changing backdrops
 
*Simply changing backdrops
 
<scratchblocks>switch backdrop to [scene2 v]</scratchblocks>
 
<scratchblocks>switch backdrop to [scene2 v]</scratchblocks>
 +
 +
The Switch to Backdrop () block can be used in many ways; its simplicity is all.
  
 
==See Also==
 
==See Also==
Line 30: Line 52:
 
*[[Next Backdrop (block)|Next Backdrop]]
 
*[[Next Backdrop (block)|Next Backdrop]]
 
{{Looks Blocks}}
 
{{Looks Blocks}}
[[Category:Looks Blocks]][[Category:Scratch 2.0]]
+
[[Category:Looks Blocks]]

Revision as of 17:51, 8 May 2013

Switch Backdrop to ()
2.0 Switch Backdrop to ().png
Category Looks
Type Stack
Introduced in 2.0

The Switch Backdrop to () block is a Looks block and a Stack block. The block changes the Stage's backdrop to the specified one.

This block is a commonly used block; it is used whenever the Stage must switch to a specific backdrop (instead of the Next Backdrop block, which does not always give the same backdrop). A variable (or any reporter) containing a number or the name of a backdrop can be dropped in.

A sprite's version is Switch to Costume ().

History

Prior to Scratch 2.0, this block was called Switch to Background () and didn't fire an event upon running. During 2.0 development, this block was also called Switch to Scene ().

Workaround

Main article: List of Block Workarounds

This block can be replicated with the following code:

repeat until <(wanted backdrop #) = (backdrop #)>
   next backdrop
end

However, it is often much faster to use the original block.

It can also be replicated with a sprite that stamps the new background.

Example Uses

Because of its simplicity, this block does not have a specific list of main uses — it is simply used to change the background of the Stage. It can be used in animations, games, simulations — anything that requires changes between backgrounds.

Some common uses are as follows:

  • Starting a level
switch backdrop to [level1 v]
when backdrop switches to [level1 v] //in a sprite
go to x:(0) y:(0)
  • A game over message
switch backdrop to [game over v]
when backdrop switches to [game over v]
hide
  • Simply changing backdrops
switch backdrop to [scene2 v]

The Switch to Backdrop () block can be used in many ways; its simplicity is all.

See Also