(Solved)Cursor gets stuck as a certain mode after leaving hotspot.

Started by FanOfHumor, Thu 31/03/2022 04:47:31

Previous topic - Next topic

FanOfHumor

When the mouse moves over a hotspot it should change it's cursor mode and then change back when it leaves.Sometimes this works but whenever the mouse moves to click on a gui and then is no longer over the hotspot it gets stuck in the cursor mode.
I just have a quit button(hotspot) and the basic Quitgame gui but if I click on one of the buttons the cursor is stuck in a mode after the gui closes.
Code: ags

function hHotspot1_AnyClick()
{
	QuitGame(1);
}

function hHotspot1_MouseMove()
{
	mouse.SaveCursorUntilItLeaves();
	mouse.Mode=eModeCleave;
}
 

eri0o

Hum, I think maybe redo this but using repeatedly execute always would help this to not happen. In this way you would use Hotspot.GetAtScreenXY(mouse.x, mouse.y) to get you which hotspot the mouse happens to be over at that frame.

If it's a room script, then use the room RepExcute - you need to create this event from the room editor, by going in the room Editor and using the ⚡icon.

https://adventuregamestudio.github.io/ags-manual/Hotspot.html#hotspotgetatscreenxy

FanOfHumor

I did forget about hotspot.Getatscreenxy.This not only solves my problem with the hotspot but also with a script that I was doing in an attempt to check if the mouse hovers over an objects graphic. Thanks for reminding me.

SMF spam blocked by CleanTalk