Discuss Scratch

hectorsouthern
New Scratcher
1 post

Change Order of Sprites

Hi,
How do I arrange sprites and choose what layer they are on? My sprites keep going behind things and I can't see them.
AonymousProfessor
Scratcher
100+ posts

Change Order of Sprites

You can use the “go to front” blocks and “go back (x) layers” blocks.
For example, if you want a sprite to be in front of everything,
when gf clicked //In sprite that goes in front
go to front

when gf clicked //In all other sprites
go to front
go back (1) layers
to make sure that the sprite is in the front.

And if you want to make sure a sprite is always in the back, you can use:
when gf clicked
go to front
forever
go back (999) layers
end
1234abcdcba4321
Scratcher
1000+ posts

Change Order of Sprites

For the always in the back…
when green flag clicked
go back (99) layers

99 layers is usually enough to push it to the back, if not, add another 9.

Last edited by 1234abcdcba4321 (Jan. 4, 2014 21:27:45)

LeedleMaster
Scratcher
55 posts

Change Order of Sprites

this should do:
when green flag clicked
go back (999999999999999999999999999999) layers
amateurradiogeek15
Scratcher
1000+ posts

Change Order of Sprites

when green flag clicked
go to front

That's the way I'd do it…at least for the front part.

when green flag clicked
go back (however many) layers
To go back.
GrandK_learning
New Scratcher
1 post

Change Order of Sprites

If sprite1 is at the back, then sprite2, then sprite 3 and then sprite4 at the front

In the script for sprite 1

when green flag clicked
go to front
show
broadcast [layer sprite2 v] and wait
broadcast [layer sprite3 v] and wait
broadcast [layer sprite4 v]

For each sprite from 2 to 4 add the following script using the correct sprite name

when I receive [layer sprite2 v]
show
go to front
DawnShades
New Scratcher
1 post

Change Order of Sprites

Peaceful8
Scratcher
100+ posts

Change Order of Sprites

To set the layer of a sprite to make sure it overlaps the ones you want, but underlaps others do this:

when Lower Sprite's Green Flag clicked ::hat ::color events // Make sure this is ordered correctly. Sets a sprite at the second layer. (or the go back number - 1 layer.)
forever ::color events
go to front ::color events
go back (1) layers ::color events
end

when Upper Sprite's Green Flag clicked ::hat ::color events // Sets it at the front layer.
forever ::color events
go to front ::color events
end ::color events

Powered by DjangoBB