Hello everyone I am looking for some advice, I am currently making my game and for the game menu I was thinking to do something like this menu inspiration
For the buttons like play option and stuff how do I make them clickable?
Hello everyone I am looking for some advice, I am currently making my game and for the game menu I was thinking to do something like this menu inspiration
For the buttons like play option and stuff how do I make them clickable?
If your using Buttons you should add a Listener like this:
yourButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
//your code
}
});
return true;
}
Hope that helps!
EDIT:
Found a little example here: http://examples.javacodegeeks.com/android/core/view/onclicklistener/android-onclicklistener-example/
You may situate your button as you want, and use in your xml layout this attribute: android:visibility="invisible"
In code you set onClickListener()
on this invisible button:
yourMenuButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// your code
}
});