drawing bitmaps on runtime

Hey,

I'm currently developing for iOS devices using Flash and Air sdk 3. I'm thinking about trying Corona to see for myself if I can really gain more fps performing the same tasks in both tools, but before I jump into testing I must make sure I'll be able to implement all the stuff I'm doing with flash within Corona sdk.

In Flash, you can easily build movieclips that contain different graphic assets and then draw it into a bitmap data and use it as a new bitmap, all that using runtime code. And you can do it in the background because you don't need the movieclip to be added to the stage to perform it.

In my game that is a must because I need to be able to create new textures on runtime each time the game starts and use them as a sprite sheet later on.

I looked everywhere and couldn't find an answer. If someone can point out to me if it's possible or not and if it is how can it be achieved.

Thanks!!

Oz

edit: I forgot to mention - I don't need to be able to save the new bitmap on the device but just use it in the current game run.

have you tried the .save method? If you want to draw primatives into a group and then save the group as a jpg/png

cheers,

?:)

Hey,

I didn't start my testings with corona yet, I'm still trying to figure out if I can achieve everything I need with it.

I red about the save method and from what I understand it doesn't fit my needs because you must have the group you want to save as a bitmap fully visible on stage and I need to build the textures in the background while loading the game. Maybe there's a workaround because I'm not fully familiar with it. If for example I can place the group behind another display object so it doesn't show and perform the bitmap save it might work as well, can you tell me if that's possible?

Although I would really like to avoid saving the bitmap on the device, then loading it back to the game for my use and after that delete it from the device (if that's even possible). I hoped Corona has an equivalent functionality like the Flash bitmapData.draw().

I haven't used it much myself, but I think if the group is invisible it can still save a copy of it's contents.

I understand what you are after, you are after an in memory bitmap that you can create that you want to blt on to the screen, but then there is no function to blt the bitmap either.

Just today there was another user that painstakingly ported the code for creating PNG files from a memory stream, but i guess it worked on windows and failed on Mac systems.

cheers,

?:)

views:1309 update:2011/10/22 9:46:13
corona forums © 2003-2011