Now, before we get started, you need to know how many rows your selection has, for example mine had 2 rows x, and 4 rows y, so you have to make sure that you dont set too many or too less rows.
Now that you have your rows memoriesed, let me go over this code with you
When down is pressed
- Code: Select all
rowy++;
if (rowy == 4)
{
rowy = 0;
y = y - 20*4;
}
y = y + 20;
The first part,
- Code: Select all
if (rowy == 4);
But wait, whats the 20 for?
The 20 is my text's height, play around with the numbers untill you get your text's size.
What about left and right?
Left and right are the same thing, I'll go over the code for the left and right, too.
- Code: Select all
rowx++;
if (rowx == 2)
{
rowx = 0;
x = x - 306 * 2;
}
x = x + 306;
My max rows x is 2, so I used 2.
But wait, whats the 306 for?
The 306 is half the width of the menu that holds my selections, this is so it matches the widnow perfectly.
Demo: