HelpJAVA Help request... GUI related

Posts 1–7 of 7 · Page 1 of 1
JAVA Help request... GUI related
So I want to make a similar to nodus where it has the arrow keys to change tabs. I've tried this: (using integers)


//Else of debug menu

private int swag = 3

If(checkKey(Keyboard.KEY_RIGHT))
{
swag = 4. //scrolls to next tab?
}

If(swag = 4)
{
Drawrect blah blah blah
}


//repeat for checkKey left and swag = 2








Any help? Solutions? Or am I looking at this wrong. Please don't tell me I'm noob or to look at nodus code because I know or have done both.

Noob out
If youre still up for it, ive done it. You can use if statements to check stuff.. For example, of the top of my head...

 
Keys
Code:
private void pKeyLeft() {
    	x -= 1;
    	if(x == -1) {
    		x = 2;
        }
}

So this is the same as using if(checkKey(Keyboard.KEY_LEFT)) { method, but I use voids.
To explain the code, I have for the left key, an integer, which when the left key is pressed, then it would do minus 1 from x. After this, I have a check, so if x is equal to -1, then set x to be 2 (where I presume 2 would be your last menu (going from 0, 1, 2) so youd skip 1 and set it to 2..).

For the right key, its the same except youd add one to x and instead of checking whether x equals to -1, youd check it so it is equal to 3, if it is, then set x to be 0.

Ok, litterally, the hard part is done. For the menu, create a new class, so it is easier to update it. And have a drawMenuText void.. Look up on tutorials and stuff. But if youre using GuiIngame method.. Well, then do the same. Do,
 
Menu
Code:
if(x == 0) {
    drawStuff();
}
if(x == 1) {
    drawMoreStuff();
}
if(x == 2) {
    onceAgainDrawStuff();
}

Uhm, instead of using the void pKeyLeft() {} you could just replace that with if(checkKey(Keyboard.KEY_BLAH)) {}.. Hope you get the idea
Isn't it amazing what a simple google search will do?
(Attachment is the Nodus Gui code, but it's a remake.)

Edit: "Have done both" So you've seen the real nodus source code? (sarcasm)

Edit 2: Since Im not currently able to scan the attatchment I removed it. However you can find it by googling " minecraft nodus gui remake"
Quote Originally Posted by LordPankake View Post

Isn't it amazing what a simple google search will do?
(Attachment is the Nodus Gui code, but it's a remake.)

Edit: "Have done both" So you've seen the real nodus source code? (sarcasm)
@LordPankake
You forgot to scan the attachment and provide virus scans. :P
Quote Originally Posted by crex View Post

@LordPankake
You forgot to scan the attachment and provide virus scans. :P
Fixed. Have OP instructions on how to find it instead.
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us