Search code examples
rotationhaxehaxeflixel

Rotating a sprite in HaxeFlixel


I'm having trouble with something very simple in HaxeFlixel, but I can't find one reference to it anywhere online.

All I need to do is rotate a FlxSprite. There are multiple references online to a .rotation value that can be set, but my sprite does not have access to this for some reason.

Can anyone help out here, I have no idea where to go from here.

The graphics I'm creating is of type Player, which extends FlxSprite and is created with loadGraphic().


Solution

  • FlxObject (which FlxSprite extends) has an angle property. Use it to rotate your sprites.