Static p5_sys::global::scale[][src]

pub static scale: ScaleInternalType
Expand description

Increases or decreases the size of a shape by expanding or contracting vertices. Objects always scale from their relative origin to the coordinate system. Scale values are specified as decimal percentages. For example, the function call scale(2.0) increases the dimension of a shape by 200%.

Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again.

Using this function with the z parameter is only available in WEBGL mode. This function can be further controlled with push() and pop().

Examples

rect(30, 20, 50, 50);
scale(0.5);
rect(30, 20, 50, 50);
rect(30, 20, 50, 50);
scale(0.5, 1.3);
rect(30, 20, 50, 50);

Overloads

s percent to scale the object, or percentage to scale the object in the x-axis if multiple arguments are given

y? percent to scale the object in the y-axis

z? percent to scale the object in the z-axis (webgl only)


scales per-axis percents to scale the object