Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Rotation Help

in General Posts: 150

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 :)


  • Posts: 2,497
    @Creator - are you talking about rotating a sprite or a vector built object? Code would help.
  • Posts: 150

    Rotating a sprite. Here’s the code I’m talking about:


  • Posts: 894

    @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()
Sign In or Register to comment.