Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: Bitmap rendering/Pre-composing

  1. #1

    Bitmap rendering/Pre-composing

    So I've got bitmap rendering down (finally) however now I want to pre-compose my bitmaps being scaled or rotated so that I can use a array I create once ot always use when creating more instances.

    I figuire I would do it by make a static var that I create a store all my precompositions at the begining of the game and just reference that array whenever I needed it. The problem is that I'm using library items with linkage ID's so I cant "draw" a BMD object without creating a new instance of the class (can i?). Is there a way around this?

    I'm also trying to avoid rendering my graphics out as images as well.

  2. #2
    Not 100% sure I understand. I think what you are trying to do is to improve performance by not having to rotate/scale bitmapData on the fly, instead having it done once at the start of the game or before?

    One solutions would be to pre-generate the necessary bitmaps before importing them into Flash. For example, if you had a 16x16 character that can be viewed from 8 different angles, you could create a 128x16 bitmap with the character rotated 45 degrees in each frame. Then, when you wanted to draw the character, you copyPixels from the static bitmapData to the actual onscreen bitmap, using an offset to determine which frame to use.

  3. #3
    Quote Originally Posted by justkevin View Post
    Not 100% sure I understand. I think what you are trying to do is to improve performance by not having to rotate/scale bitmapData on the fly, instead having it done once at the start of the game or before?
    Yup, that's exactly what I'm trying to do. However the method you desribed is alot less practical than just doing the rotation and storing the images in AS as opposed to making a bigger image then cutting it up.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012