Jump to content
  • Advertisement
Sign in to follow this  
forth

[web] [Flash-AS3] one image load, multiple uses

This topic is 3557 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My friends and I have decided to try to make a game for flash player 9 in AS3. Since it'll be a real-time tiled strategy game, we will have the same tiles used(rendered) on different map locations. If we were to load the same tile over and over again for each map render this would eat up a lot of memory. So, now I'm asking, if there's a way to load the tile(bitmap) once and then, when I want to render it 100 times, I'd just referenced to it, instead of loading it again? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Once loaded, make multiple bitmapData objects, and then do bitmapData.draw(myImage).

Or, you could create a Shape(), and then do a myShape.graphics.beginBitmapFill(myImage), but you might first have to draw myImage to a BitmapData object, and then myShape.graphics.beginBitmapFill(myBitmapData);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!