major GUI headache

Started by , Wed 17/12/2003 21:18:20

Previous topic - Next topic

nick7000

okay, i need some help on this. im trying to get a gui that displays your selected action and the object your cursor is on (for example: Talk to Bob). i have no idea how to achieve this. PLUS im tryin to get the this GUI to be completely transparent EXCEPT for the text. is this possible? thanks in advance

Scorpiorus

Quoteokay, i need some help on this. I'm trying to get a gui that displays your selected action and the object your cursor is on (for example: Talk to Bob).

in the global repeatedly_execute:

if (GetCursorMode() == MODE_TALK) SetLabelText(GUI, LABEL, "Talk to @OVERHOTSPOT@");
else if (GetCursorMode() == MODE_USE) SetLabelText(GUI, LABEL, "Interact with @OVERHOTSPOT@");
else if (GetCursorMode() == MODE_LOOK) SetLabelText(GUI, LABEL, "Look at @OVERHOTSPOT@");


QuotePLUS I'm tryin to get the this GUI to be completely transparent EXCEPT for the text. is this possible?

just set GUI's both background and foreground color to 0.

~Cheers

nick7000

Quote from: Scorpiorus on Wed 17/12/2003 21:37:33

in the global repeatedly_execute:

if (GetCursorMode() == MODE_TALK) SetLabelText(GUI, LABEL, "Talk to @OVERHOTSPOT@");
else if (GetCursorMode() == MODE_USE) SetLabelText(GUI, LABEL, "Interact with @OVERHOTSPOT@");
else if (GetCursorMode() == MODE_LOOK) SetLabelText(GUI, LABEL, "Look at @OVERHOTSPOT@");


there seems to be a problem. when i paste this in, i get an error stating "undefined symbol: LABEL". do you know how i can solve this? i greatly appreciate the help

Scorpiorus

I meant it to be a GUI label number. Create a GUI and add a label, next feed both GUI name and label number into  SetLabelText() function.

example:
GUI's name GUI3
GUI's label number 0

SetLabelText(GUI3, 0, "Look at @OVERHOTSPOT@");

Ishmael

Hee Hee ;D I've posted that code on this forum, but I think nobody reads it as they don't look into the beginner help theads...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

nick7000

okay, i got it all working. but how can i set it up to display invntory actions, as in "Use sponge with water"?

Ishmael

Quotebut I think nobody reads it as they don't look into the beginner help theads...

http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=6240

::)
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

nick7000

i get an error which reads: Error(line 19): cannot assign to string; use Str* functions instead.

line 19 is this: useinvnum=GetInvName(mouse.x,mouse.y);

Ishmael

Ah, it should be:

string usinginv;
string useinvtxt;
StrCopy (useinvtxt, "Use ");
GetInvName(character[GetPlayerCharacter()].activeinv,usinginv);
StrCat (useinvtxt,usinginv);
StrCat (useinvtxt," with ");
StrCat (useinvtxt,"@OVERHOTSPOT@");
SetLabelText(0,0,useinvtxt);

inside the if (GetCursorMode() == 4) {}...

Sorry 'bout that..
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk