Is there any way that I can rotate a 2d circle without it moving? Like is there a way to just rotate the circle and not make it rotate around a certain point??
Thanks
Is there any way that I can rotate a 2d circle without it moving? Like is there a way to just rotate the circle and not make it rotate around a certain point??
Thanks
@Creator - are you talking about rotating a sprite or a vector built object? Code would help.
Rotating a sprite. Here’s the code I’m talking about:
—Rotate(ElapsedTime)
@Creator27 here are three examples which should help.
Basically if you are inside pushMatrix —> popMatrix it will read the rotation, translation and scaling from the sprite command upwards
-- Rotate srpite first then translate rotated sprite into screen position
pushMatrix()
translate(WIDTH/2,HEIGHT/2)
rotate(ElapsedTime)
sprite(asset.builtin.Blocks.Brick_Grey,0,0)
popMatrix()
-- Move the sprite and then rotate it around the origina (bottom left of the screen)
pushMatrix()
rotate(ElapsedTime)
translate(WIDTH/2,HEIGHT/2)
sprite(asset.builtin.Blocks.Brick_Red,0,0)
popMatrix()
--Does the same, but the "move" is embedded within the sprite call
pushMatrix()
rotate(ElapsedTime)
sprite(asset.builtin.Blocks.Cactus_Inside,WIDTH/2,HEIGHT/2,50,50)
popMatrix()