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.
X Scroll
(x scroll:: sensing)
Category Sensing (v154-v171), Motion (v152-v153, 3.0)
Type Reporter
Introduced in v152 (2.0 alpha)
Removed in v172 (2.0 alpha)
(x scroll::motion)
The X scroll block's appearance in Scratch 3.0.

The X Scroll block was a Sensing block and a Reporter block. The block reported how far right the stage was scrolled. If it had been scrolled left, a negative number is returned. It was removed late in the alpha.

When the block was originally introduced, it was a motion block. This lasted for two version before the block was changed to a Sensing block in v154. When obsolete blocks were added in 3.0 for compatibility as hidden blocks, the block was re-introduced as a motion block rather than a Sensing block.

Example Uses

  • Showing a message when a player is scrolled to a certain x position.
when gf clicked
show variable [message v]
forever
if <(x scroll::sensing) > (99)> then
set [message v] to [This is the forest.]
else
set [message v] to [This is the farm.]
end
  • Playing an animation when a player is scrolled to a certain x position.
when gf clicked
forever
if <(x scroll::sensing) < (50)> then
broadcast [swim animation v]
else
broadcast [walk animation v]
end
end

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.