If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

scale(amount)

Increases the size of shapes drawn after the command, by expanding and contracting vertices. For example, scale(2) makes it increase in size by 200%. If called multiple times, the sizes will multiply (accumulative effect). It can be called with one parameter to resize the same in both dimensions, or with two parameters to size differently in each dimension. To stop resizing shapes, use pushMatrix()/popMatrix().
For a more detailed description of scaling, read this article.

scale(amount)

Parameters:
NameDescription
amountThe amount to scale in x and y axis

scale(x, y)

Parameters:
NameDescription
xThe amount to scale in x axis
yThe amount to scale in y axis

Want to join the conversation?

No posts yet.