This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Transform
Atsuya Sato edited this page Nov 30, 2018
·
2 revisions
iOS, OSX
fill(255, 255, 255)
rect(0, 0, 50, 50) // White rectangle
pushMatrix()
translate(30, 20)
fill(0, 0, 0)
rect(0, 0, 50, 50) // Black rectangle
popMatrix()
fill(100, 100, 100)
rect(15, 10, 50, 50) // Gray rectangle
Pushes the current transformation matrix onto the matrix stack
iOS, OSX
fill(255, 255, 255)
rect(0, 0, 50, 50) // White rectangle
pushMatrix()
translate(30, 20)
fill(0, 0, 0)
rect(0, 0, 50, 50) // Black rectangle
popMatrix()
fill(100, 100, 100)
rect(15, 10, 50, 50) // Gray rectangle
Pops the current transformation matrix off the matrix stack
iOS, OSX
rect(30, 20, 50, 50)
scale(0.5)
rect(30, 20, 50, 50)
Increases or decreases the size of a shape by expanding and contracting vertices
iOS, OSX
shear(QUARTER_PI, 0)
rect(10, 10, 30, 30)
Shears a shape.
iOS, OSX
translate(width/2, height/2)
rotate(PI/3.0)
rect(-26, -26, 52, 52)
Rotates the amount specified by the angle parameter.
iOS, OSX
translate(30, 20)
rect(0, 0, 55, 55)
Specifies an amount to displace objects within the display window.