Author Topic: loadRotatedGraphic() on a FlxSprite with an animation  (Read 1429 times)

KWarp

  • Active Member
  • ***
  • Posts: 105
  • Karma: +0/-0
  • Game Programmer
    • View Profile
    • kwarp.com
Heyo,

I have a FlxSprite with 2 frames of animation. This sprite rotates a lot. Is there any way I can take advantage of loadRotatedGraphic() on each particular frame of the animation?

The documentation for Flixel 2.35 seems to suggest that I can do it, but I haven't figured it out.

I'm looking to compare my current code to working code. Please share any code samples if available.

Thanks,

To understand recursion, you must first understand recursion.

Adam Atomic

  • Founder
  • Key Contributor
  • *****
  • Posts: 852
  • Karma: +0/-0
  • new dad
    • View Profile
    • Adam Atomic
Re: loadRotatedGraphic() on a FlxSprite with an animation
« Reply #1 on: Tue, Apr 26, 2011 »
The only way to do this currently is to make one rotated sprite for each frame, and handle toggling between them yourself, perhaps stuffing them both into a flxobject for the sake of simplicity and collisions, and just override draw/render to display the sprites accordingly

KWarp

  • Active Member
  • ***
  • Posts: 105
  • Karma: +0/-0
  • Game Programmer
    • View Profile
    • kwarp.com
Re: loadRotatedGraphic() on a FlxSprite with an animation
« Reply #2 on: Tue, Apr 26, 2011 »
Noted. Thanks for the info.
To understand recursion, you must first understand recursion.

Galtrhan

  • Member
  • **
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: loadRotatedGraphic() on a FlxSprite with an animation
« Reply #3 on: Tue, May 24, 2011 »
Could anyone please post an example how to do that?