Simple one I'm sure . [SOLVED]

Started by Candle, Wed 05/01/2005 00:16:28

Previous topic - Next topic

Candle

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 ?

Ashen

Try:
1) Create an int in the Room Script, called 'this'
Code: ags

// 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:
Code: ags

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.
I know what you're thinking ... Don't think that.

Candle

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

Ashen

Yup, and also one on the next line.
I know what you're thinking ... Don't think that.

Candle

#4
Cool so I just need to change the number to the next hotspot  number for the next  txt overlay  . thanks

Candle

How can I change the size of the fonts ? besides installing a new smaller font .

Gilbert

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.

Candle


TerranRich

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.
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk