Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing a game that uses different images.When am image is swiped to the bottom of the screen it disappears and a new image appears at the top.Seeing as you can't delete an individual image I want to clear the canvas and redraw the images from an array of images. My question is how do you create an array that is accessible from the onDraw method?

share|improve this question
up vote 3 down vote accepted

This sounds like a simple scope issue. One method could be to implement a static management class that is responsible for the images. You could then get the data from this management class at any point in time. This allows you to encapsulate your data, and provide additional methods for manipulating your image data at will.

share|improve this answer
Thanks I'll give this a go. – davemc Feb 5 '13 at 10:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.