Text Cuts Off On The Overhotspot Gui

Started by Ghostlady, Sat 12/07/2025 04:52:02

Previous topic - Next topic

Ghostlady

Neither of these work.  The last one throws the cursor at the top left of the screen.

Code: ags
//x = mouse.x + 10;
//y = mouse.y + 10;


if (x + gGui9.Width > System.ViewportWidth)
    x = System.ViewportWidth - gGui9.Width;

if (y + gGui9.Height > System.ViewportHeight)
    y = System.ViewportHeight - gGui9.Height;
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Crimson Wizard

Why did you disable these lines?

Code: ags
x = mouse.x + 10;
y = mouse.y + 10;

They are the ones that make the gui follow the mouse.

I've only posted the lines that needed to be changed last time...

Here's the full code that has to be present:

Code: ags
  int x = mouse.x + 10;
  int y = mouse.y + 10;

  if (x < 0)
    x = 0;
  if (x + gGui9.Width > System.ViewportWidth)
    x = System.ViewportWidth - gGui9.Width;
  if (y < 0)
    y = 0;
  if (y + gGui9.Height > System.ViewportHeight)
    y = System.ViewportHeight - gGui9.Height;

  gGui9.SetPosition(x, y);

Ghostlady

Those lines were not really disabled, they were showing in the script, that was a commented out duplicate. I didn't catch it all. But this shows more code. I had a weird symbol showing up in the code before so I don't think I caught it at all.  But good news! It is working now.  Wow that was crazy.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

SMF spam blocked by CleanTalk