Commits

Brendan Howell  committed d197a09

image scale, rotate and flip example

  • Participants
  • Parent commits b98b5fb

Comments (0)

Files changed (1)

File examples/image-transforms.cess

+# image transformations
+img = Image("image.jpg")
+
+x = 50
+
+def draw():
+    global x
+
+    setBackground(0,0,0)
+    
+    #scale to x, y pixels
+    img.scale(x,x)
+    
+    #rotate in degrees
+    img.rotate(x)
+    
+    #flip along x,y or both axes
+    img.flip()
+    
+    img.draw(50, 40)
+    
+    x += 1
+    
+    if x > 360:
+       x = 0