1. Download our Official Android App: Forums for Android!

Apps Handling multiple sprites/Bitmaps in a project

Discussion in 'Android Development' started by sump38, Jun 16, 2011.

  1. sump38

    sump38 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    4
    Joined:
    Jun 16, 2011

    Jun 16, 2011
    4
    0
    5
    Hi everyone, very new here, but i hope i'll get the hang of things quickly and be able to help often :)

    so,
    i lately started building a project with a surfaceview and multiple objects, each with it's own bitmap to draw.
    now i'm trying to figure out the best way to handle all those resources.
    i have all the bitmaps located in my res/drawable/ folder and what i want to have is a set of my objects, each with it's own bitmap.

    several things i thought about were:
    1. passing the context to each object's constructor - this might solve it, but it would be cumbersome and having a different bitmap object for every new object of the same type is not very resource friendly.

    2. making an object that holds all the bitmaps for later access. but in this case, how should i design it? static or as an object, and should i pass it to the other objects? so many options! :)

    3. any ideas would be accepted here, i would love to hear any suggestion!


    thank you for your time, and sorry for the long post. sump.
     

    Advertisement

  2. sump38

    sump38 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    4
    Joined:
    Jun 16, 2011

    Jun 16, 2011
    4
    0
    5
    desperate bump.. :(

    really would appreciate any idea here

    i'll try to sum up the question:

    what in your opinion would be a good way to create classes that have their own sprites(Bitmap)?
    giving the Bitmap to the constructor would be very annoying to change afterwards and also not very programmer friendly.
    and giving them the context, would result in creating a different Bitmap object for every instance of the Class..


    any ideas at all (please :)?
     

Share This Page

Loading...