Sign in to follow this  
nollyj

How can I create this button for android game

Recommended Posts

nollyj    102

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

Share this post


Link to post
Share on other sites
Avalander    2412

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this