Need help with......I don't know what it's called

Started by wotmeworry, Mon 13/10/2008 07:20:03

Previous topic - Next topic

wotmeworry

I'm sure you've noticed that these adventure games usually have something on the GUI that says "Look at Poster" or "Use Key with Door" or something similar that changes appropriately as you move the mouse around the screen. I don't know if I should be asking this here or in the technical questions page:

How do you do that??

The Help section mentions using @OVERHOTSOPT@ but that just shows the thing your mousing over.

please help! :P

Matti

I don't know but there's a LucasArts GUI help thread in the beginners technical and there's a modul for that too as far as I know.

Ghost

A simple way is to create a GUI that contains a label, and then write a function and call this from repeatedly_execute. In that function, you check the mouse.mode to set a "verb", and what the mouse is over.

Something like this
Code: ags

function myCreateScummText() 
{
  if (mouse.Mode == eModeWalkto)    { lblScummText.Text = "walk to "; }
  if (mouse.Mode == eModeLookat)    { lblScummText.Text = "look at "; }
  if (mouse.Mode == eModePickup)    { lblScummText.Text = "take "; }
  if (mouse.Mode == eModeInteract)  { lblScummText.Text = "use "; }
  if (mouse.Mode == eModeTalkto)    { lblScummText.Text = "talk to "; }
  
  if (mouse.Mode == eModeUseinv)    { lblScummText.Text = "use ";
                                      lblScummText.Text = lblScummText.Text.Append(player.ActiveInventory.Name);
                                      if (Game.GetLocationName(mouse.x, mouse.y) != player.ActiveInventory.Name) {
                                        lblScummText.Text = lblScummText.Text.Append(" on ");
                                        lblScummText.Text = lblScummText.Text.Append(Game.GetLocationName(mouse.x, mouse.y));
                                      }                                    
                                    }
    if (mouse.Mode != eModeUseinv)  { lblScummText.Text = lblScummText.Text.Append(Game.GetLocationName(mouse.x, mouse.y)); }
}


In this example, the label in out GUI is called lblScummText. All you need to do then is call this from repeatedly_execute, and off you go.

Code: ags

function repeatedly_execute {
  myCreateScummText();
}

wotmeworry

thanks heaps!!

Sorry I didn't notice that thread about lucasarts GUIs. I'll be sure to check up there next time ;D ;D

SMF spam blocked by CleanTalk