Gamua / Sparrow-Framework

The Open Source Game Engine for iOS
http://www.sparrow-framework.org
Other
294 stars 83 forks source link

Store the result of a tween as a GIF file #56

Open Briahas opened 8 years ago

Briahas commented 8 years ago

Hi, I'm trying to perform subj but with no luck. Is it possible somehow?

PrimaryFeather commented 8 years ago

What exactly are you trying to do - store the result of a tween as a GIF file?

Briahas commented 8 years ago

Yes

PrimaryFeather commented 8 years ago

Sparrow does not contain such a functionality, sorry!

PrimaryFeather commented 8 years ago

@racarone - in the latest version, is there a way to store the content of a bitmap object or the stage to a file? If that's possible, you can probably find some other library to link those images together in one GIF.

racarone commented 8 years ago

You can get a UIImage representation of the stage with the drawToImage method. Though there is also a debugQuickLookObject method on DisplayObject that will return a UIImage representation of the display object and its contents. You could, like Daniel said, use another library and link the images together after capturing a UIImage from the display object for each frame you needed.

Briahas commented 8 years ago

@racarone Thanks for answers. My Sparrow version is too low for this (1.2). I did it through [[SPTexture alloc] initWithWidth:....] -> [[SPBitmapData alloc] initWithTexture:] -> [bmap drawDisplayObject:sprite]