Alright, the Interface function is being drawn on screen.
Problem though is the buttons aren't switching,
meaning, I'm guessing, the variable "select" isn't being affected.
So I tried this:
SetRenderScript("Interface(1)");
var select = 1;
function Interface(select)
{
win2.drawWindow(x+1,y+h-15,w-2,14);
if (select == 1) {
Picon01.blit(x+45, y+h-16);
icon02.blit(x+62, y+h-16);
icon03.blit(x+79, y+h-16);
icon04.blit(x+96, y+h-16);
}
if (select == 2) {
icon01.blit(x+45, y+h-16);
Picon02.blit(x+62, y+h-16);
icon03.blit(x+79, y+h-16);
icon04.blit(x+96, y+h-16);
}
if (select == 3) {
icon01.blit(x+45, y+h-16);
icon02.blit(x+62, y+h-16);
Picon03.blit(x+79, y+h-16);
icon04.blit(x+96, y+h-16);
}
if (select == 4) {
icon01.blit(x+45, y+h-16);
icon02.blit(x+62, y+h-16);
icon03.blit(x+79, y+h-16);
Picon04.blit(x+96, y+h-16);
}
while (AreKeysLeft())
{ switch(GetKey()) {
case KEY_ENTER:
if (select >= 4) { select--; }
if (select <= 1) { select++; }
break;
}
}
}
Running the variable through the parentheses, and changing the variable called in the parentheses works,
but still isn't affected when the ENTER key is pressed. Any ideas?
And two other questions to help understand:
Why does "select" have to be a Global variable, instead of Local?
And I also though you said SetRenderScript() already runs in a while-loop, and that we shouldn't use them? Special case?
. . .
Also, Debug still isn't working.
And the variable "Debug" was a toggle,
atleast that's what I thought I was scripting it as with the whole false v.s. true bit.
//----------DeBug------------\\
var Debug = false;
var show_debug = false;
function Render()
{
if (show_debug) { DrawDebug(); }
while (AreKeysLeft()) {
if (GetKey() == KEY_CTRL) show_debug = !show_debug;
}
}
function DrawDebug()
{
//wind.drawWindow(x+4,y+h-35,w-8,31);
wind.drawWindow(x+3,y+h-18,w-6,15);
font.drawText(x+4,y+h-17, "[ABCDEFGHIJKLMNOPQRSTUVWXYZ]");
font.drawText(x+4,y+h-10, "0123456789 ABDP,C.E");
//font.drawText(x+65,y+h-9, "N_X: " + NowTileX);
}