1
\$\begingroup\$

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?

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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