I have a game that uses 4 bitmaps. I was just wondering if I should destroy these bitmaps onpause of the game and then recreate them, or leave them as is?
Asked
Active
Viewed 460 times
0
-
I did as Theodor suggested and kept them on static variables. Mostly because I need to use them in several different places but it also keeps it while the app is running and you don't have to process it again. I was also wondering if there is a better approach to this. – caiocpricci2 Oct 18 '12 at 12:44
-
This approach was used in "Beginning Android 4 Games Development" which is the best book imo for learning how the game development works on android.You can always create a manager and recycle the bitmaps when you don't need'em but don't forget to create'em again when you need'em because after calling recycle on a Bitmap it can't be used anymore.Also imo 4 bitmaps aint that much to hold in memory(specially if they are small). – Teodor Oct 19 '12 at 10:55