Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Wed 05/01/2005 00:16:28

Title: Simple one I'm sure . [SOLVED]
Post by: Candle on Wed 05/01/2005 00:16:28
Say you have a book with hotspot over it and when the mouse moves over it you have txtx show something like "This is the book you need"
How would you do that ? or can you point me to the help file that shows how .
CreateTextOverlay (50,80,120,2,15,"This is a text overlay"); <-- think using this maybe ?
Title: Re: Simple one I'm sure .
Post by: Ashen on Wed 05/01/2005 01:18:04
Try:
1) Create an int in the Room Script, called 'this'

// room script file
int this;

The name isn't important, of course, as long as you use the same one in the next bit.

2) Add this to the room's Repeatedly_Execute:

if ((GetHotspotAt (mouse.x, mouse.y) == 2) && (IsOverlayValid (this) == 0)) this = CreateTextOverlay (50,80,120,2,15,"This is the book you need.");
else if ((IsOverlayValid (this) == 1) && (GetHotspotAt (mouse.x, mouse.y) != 2)) RemoveOverlay (this);

Making sure that the Hotspot in the GetHotspotAt commands is the right one, and changing the CreateTextOverlay values (x, y, font, etc) to suit.

Of course, if you've got a statusline GUI already, there's probably a simpler way.
Title: Re: Simple one I'm sure .
Post by: Candle on Wed 05/01/2005 01:35:33
Works great , took me a sec to find what the hotspot was then seen the 2
if ((GetHotspotAt (mouse.x, mouse.y) == 2)  that was the hotspot number right ? lol
Title: Re: Simple one I'm sure .
Post by: Ashen on Wed 05/01/2005 01:38:16
Yup, and also one on the next line.
Title: Re: Simple one I'm sure .
Post by: Candle on Wed 05/01/2005 01:43:54
Cool so I just need to change the number to the next hotspot  number for the next  txt overlay  . thanks
Title: Re: Simple one I'm sure . [SOLVED]
Post by: Candle on Wed 05/01/2005 07:35:38
How can I change the size of the fonts ? besides installing a new smaller font .
Title: Re: Simple one I'm sure . [SOLVED]
Post by: Gilbert on Wed 05/01/2005 07:40:42
I think you can't do that after import (size of SCI fonts can never be changed, TTF size can be set upon importing), you have to import another.
Title: Re: Simple one I'm sure . [SOLVED]
Post by: Candle on Wed 05/01/2005 07:50:17
Ok Thanks for the info
Title: Re: Simple one I'm sure . [SOLVED]
Post by: TerranRich on Wed 05/01/2005 15:20:28
Quote from: Candle on Wed 05/01/2005 07:35:38How can I change the size of the fonts ? besides installing a new smaller font.

BFAQ'ed: http://bfaq.terran-x.com/#graphics31 Good question.