Answer the question
In order to leave comments, you need to log in
Level selection menu in the game (Android)?
Tell me how to make a fancy level selection menu in the game, like in Angry Birds or Blast Monkey (and so that finger scrolling with smooth movements is supported there).
I'm making a game using libgdx and do I have to implement it manually or can I use built-in Android UI components?
Here's what it should look like:
Answer the question
In order to leave comments, you need to log in
A customized HorizontalScrollView, for example, where you stuff your custom buttons (with all the quick, points and other nonsense), by pressing the libgdx level is already loaded directly, I do not advise you to do it as part of the libgdx activation.
If you are not doing with Stage and Actors, I recommend switching to them.
It is done like this. Several Actors are created, one for each level. The Stage is set to two float variables, such as prevLevel and currLevel. They affect the drawing of levels-Actors: each unit means an offset along the X axis by a certain distance (if we take the screen from Angry Birds, it will be a segment between the right edges of two levels). If the user draws a line with a finger, then it is necessary to remember when pressing prevLevel, and change currLevel to (length between pressure points) / (distance between edges). After releasing your finger, you need to change currLevel in the opposite direction from prevLevel, to the nearest integer (thus creating an animation). If the length of the segment between pressing and releasing the finger is too small, then it is necessary to react depending on where the pressing occurred: if in the center, we start the level,
It's not very clear, but I don't know how to explain it more clearly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question