Scratch imposes limits on both the minimum and maximum size of a sprite which depend on the dimensions of its current costume. It is possible to go beyond both limits and this tutorial shows how.


Note Warning: Going beyond the limits may result in unexpected behavior with no guarantee that the sprite will look the same across all devices.[1]

Large Size

To make a sprite larger than it is normally possible, create a costume with a width and height of 0. This is achieved by editing an empty canvas in vector mode (delete all shapes or use the eraser tool).

The code is as simple as switching to the 0x0 costume and setting the size:

switch costume to (blank v) // this is the 0x0 costume which allows a large size
set size to (10000)% // set size to a large value
switch costume to (costume1 v) // switch to the costume you want to see

This can be made into a custom block script that remembers the current costume and switches back after setting the size:

define set large size (size)
set [costume v] to (costume [number v]) // this remembers the costume number
switch costume to (blank v)
set size to (size)%
switch costume to (costume) // switch costume back

This allows sizes between 100% and Infinity.

Small Size

There are two ways to do this:

Create a costume with an extremely large shape in it. Then, add this code:

switch costume to (large v) // this is the large costume which allows a small size
set size to (1)% // set size to a small value
switch costume to (costume1 v) // switch to the costume you want to see

Or as a custom block:

define set small size (size)
set [costume v] to (costume [number v]) // this remembers the costume number
switch costume to (large v)
set size to (size)%
switch costume to (costume) // switch costume back

Small and Large Size

The above two methods can be combined so that a sprite can be set to both small and large sizes. This requires having both a small and large costume.

define set size to (size)
set [costume v] to (costume [name v]) // this remembers the costume name
if <(size) < [100]> then
  switch costume to (large v)
else
  switch costume to (blank v)
end
set size to (size)%
switch costume to (costume) // switch costume back

See Also

References

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