• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Handling multiple sprites/Bitmaps in a project

sump38

Lurker
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.
 
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 :)?
 
Back
Top Bottom