Hi all,
How do I code up a sprite to rotate on its axis and remain stationary ?
TIA,
Carlos
Hi all,
How do I code up a sprite to rotate on its axis and remain stationary ?
TIA,
Carlos
A starter for 10
-- Use this function to perform your initial setup
function setup()
print("rotate")
rotation=0
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
pushMatrix()
translate(100,100) --the centre of the point of rotation
rotate(rotation)
sprite("Planet Cute:Heart",0,0)
popMatrix()
rotation = rotation - 1
--change this to + 1 to rotate the other way
--increase the value to rotate faster
end
Thanks West that was exactly what I needed. Cheers !