How can I create this button for android game

Started by
0 comments, last by Avalander 9 years, 11 months ago

I am new here and new to android game development. I attached a screenshot of the kind of Maths game I want to code in android. This is the condition

Note: I don't want to use any game engine or library

I want to use android SDK ie either to extend a View class or use the SurfaceView.

What I have in mind is to create a class that represents button with attributes for Id, Bitmap Image and color and add about 64 instances of the class to a data structure (List).

My questions now is after I rendered the buttons on the canvas. If a user get an answer correct, the buttons click should disappeared from the canvas. I am not sure how best to make the button disappear. My guess is to draw the background color over the button that will disappear.

Please if you have a better workflow on how best to create this kind of Maths game, I will really appreciate it.

Thanks in advance

Advertisement

What have you tried already?

If you use a Button or ImageView for the button, or if you extend some View class, you can just call .setVisibility(View.INVISIBLE) or .setVisibility(View.GONE) to make it disappear.

This topic is closed to new replies.

Advertisement