| Go () () Layers | |
go [ v] () layers | |
| Category | Looks |
| Type | Stack |
| Introduced in | 3.0 |
The Go () () Layers block is a Looks block and a stack block. The block moves its sprite forward or backward a given number of layers. Moving a sprite forward causes it to appear in front of other sprites, and moving it backwards causes it to appear behind other sprites. If the input is a non-whole number, it will be rounded to the nearest whole number. If the input is 0, it will not move layers. If the input is a negative number, it will move in the opposite direction.
History
Before Scratch 3.0, there were only the Go to Front and Go Back () Layers blocks. To move a sprite forward, one would use the Go Back () Layers block with a negative input.
Example Uses
The dropdown input in the block has two options: forward and backward. Some common uses are:
- Making a sprite go behind another sprite
- Moving sprites in 3-dimensional scenes and animations
- Stacking sprites on top of each other (from a bird's-eye view)
It can be used in conjunction with the Go to () Layer block to move a sprite to a specific layer. For example,
go to [back v] layer go [forward v] (3) layers
moves a sprite to the 4th layer from the back.
See Also
| For sprites |
Say () for () Seconds • Say () • Think () for () Seconds • 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 () • Size
|
| For the Stage | |