Author Topic: Overhotspot label text goes off screen when mouse cursor is inventory item  (Read 629 times)

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Part of the problem is that the links don't lead to the actual manual entry because for some reason the anchor in the link is turned to lowercase. Whenever I link to a command in the online manual I have to fix the anchor part.

Oh yeah, it was past my bed time heh. That z order works just fine, although I'll see if I prefer the transparency, but at least I can fall back on z order.

However I realised I do need the text width thing, as longer descriptions don't display the whole text. AGS didn't recognise lblOverhotspot, so I assumed that was what my GUI label name is, so I changed that, but when I run the game, the hotspot descriptions completely disappear. Could this be related to what Crimson said about the verb coin? I might have to restrict my descriptions to not be very long, what a bother.

This is how I modified Khris' script for my label name:

Code: Adventure Game Studio
  1.  // before calculating the position, set label and GUI width based on text
  2.   String ln = Game.GetLocationName(mouse.x, mouse.y);
  3.   overhotspot.Text = ln;
  4.   overhotspot.Width = GetTextWidth(ln, overhotspot.Font) + 2; // small error margin to ensure text doesn't wrap
  5.   gOverhotspot.Width = overhotspot.Width; // assuming label's x coordinate on GUI is 0
  6.   // gui position calculations here