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.
Go to Front
2.0 Go to Front.png
Category Looks
Type Stack

The Go to Front block was a Looks block and a Stack block. The block would place a sprite in front of all other sprites. It was replaced by go [ v] () layers in Scratch 3.0, because the new block could send a sprite both forward and backward.

Example Uses

As this block puts the sprite in front of others, it was widely used in setting up three-dimensional scenes, or placing objects in front of other objects. Some common uses were:

  • Putting an object closest to the viewer in 3 dimensional animation
  • Making sure an object sprite is on a table sprite by putting the object in the front
  • Putting buttons in front of a toolbar
when I receive [show toolbar v] //in the toolbar sprite
go to front //so the toolbar's menu is not behind anything
show
broadcast [tools v] //now tell the tools to show

when I receive [tools v] //in each tool sprite
go to front //so it is in front of the tool bar
show
  • Covering one sprite with another
  • Simply moving one object in front of another

This block was often used in conjunction with the Go Back () Layers block to move a sprite to a specific layer. For example, this script moved a sprite to the 6th layer from the front (which means there were 5 sprites on top of it):

go to front
go back (5) layers

Workaround

Main article: List of Block Workarounds

This block could be replicated with the following code:

go back ((-1) * ((object count) + (1))) layers

The variable "object count" should be set to the number of objects (sprites, Stage Monitors, etc.) on the Stage.

It could also be replaced by using the Go Back () Layers block with a negative number inside.

Replacement

In Scratch 3.0, this block was replaced by go to [ v] layer for also being able to send a sprite to the very back. The Go Back () Layers block was also replaced.

See Also