From Test-Scratch-Wiki

Revision as of 10:29, 6 December 2017 by Mass editor (talk | contribs) (Automated edit: Updated Test Wiki copy of English Wiki page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Translate: - English 
Archive.png This article or section documents a feature not included in the current version of Scratch (2.0). It is only useful from a historical perspective.
Align Scene ()
Align Scene.png
Category Motion
Type Stack
Introduced in 2.0 alpha
Removed in 2.0

The Align Scene () block was a Motion block and a Stack block. It worked in conjunction with the built-in scrolling mechanism that never made it past the late Scratch 2.0 Alpha stage. The block set the scrolling position of the Stage to the specified argument. The options of the dropdown were "top-left", "top-right", "middle", "bottom-left", and "bottom-right".

Example Uses

  • Realigning the Stage after panning in a scrolling game
when gf clicked
set [yvel v] to (0)
go to x: (0) y: (0)
align scene [middle v]::motion
set [lives v] to [3]
repeat until <(lives) = [0]>
scroll right (-5)::motion
if <key [up arrow v] pressed?> then
change [yvel v] by (1.3) //upward motion
if <key [down arrow v] pressed?> then
change [yvel v] by (-1.3) //downward motion
change [yvel v] by (-0.4) //gravity
set [yvel v] to ((yvel) * (.87)) //physics
if <<touching [enemy v]?> or <(y position) < (-239)>> then
change [lives v] by (-1)
  • Using set locations as a base for panning
when gf clicked
ask [Specify the location you would like to view of the house] and wait
if <<(answer) = [middle]> or <(answer) = [center]>> then
align scene [middle v]::motion
if <<(answer) = [top-left]> or <(answer) = [top left]>> then
align scene [top-left v]::motion

See Also