Overhotspot label text goes off screen when mouse cursor is inventory item

Started by ManicMatt, Thu 17/05/2018 14:54:35

Previous topic - Next topic

Khris

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.

ManicMatt

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

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

SMF spam blocked by CleanTalk