Using rows to make advanced menus

You must understand the Game Editor concepts, before post here.

Using rows to make advanced menus

Postby Hblade » Wed Sep 02, 2009 6:03 am

Hey guys its me again and I found a way to make advanced menus by using rows. First, make 2 variables called rowx and rowy, now make an actor, (preferd half the size of the window your selections are in... before I get started let me explain what this does. Look at this screenshot
menuscreeny.jpg

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);
tells the program that when it's at the botom of the selection, it resets the rows to 0. (Mine is 4 rows y, so I used 4.), The second part, y = y - 20*4, again remember that my max rows are 4, so if you have 5 rows, you'd say y = y - 20*5;.

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:
Rows.zip
(4.39 MiB) Downloaded 120 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron