Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 17/12/2003 21:18:20

Title: major GUI headache
Post by: on Wed 17/12/2003 21:18:20
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
Title: Re:major GUI headache
Post by: Scorpiorus on Wed 17/12/2003 21:37:33
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
Title: Re:major GUI headache
Post by: on Wed 17/12/2003 22:07:42
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
Title: Re:major GUI headache
Post by: Scorpiorus on Wed 17/12/2003 22:13:59
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@");
Title: Re:major GUI headache
Post by: Ishmael on Fri 19/12/2003 10:07:11
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...
Title: Re:major GUI headache
Post by: on Fri 19/12/2003 11:07:58
okay, i got it all working. but how can i set it up to display invntory actions, as in "Use sponge with water"?
Title: Re:major GUI headache
Post by: Ishmael on Fri 19/12/2003 11:45:50
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

::)
Title: Re:major GUI headache
Post by: on Fri 19/12/2003 12:03:01
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);
Title: Re:major GUI headache
Post by: Ishmael on Fri 19/12/2003 13:14:17
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..