Strange hover cursor behaviour

Started by Pollux, Sun 21/07/2019 11:45:07

Previous topic - Next topic

Pollux

Hi there,

First of all - I don't much understand scripting...

But I wanted the cursor to change everytime it hovers over the exit hotspot.

I simply copypasted the code from a different game, because I am really a noob in this :D

the code says:

Code: ags

function Exit_MouseMoveG() { // makes sure cursor changes to warp when hovering on exit hotspot
	if (mouse.Mode != eModeUseinv) { // unless it's an inventory cursor, which overrides
		Mouse.SaveCursorUntilItLeaves();
		mouse.Mode = eModeLeaving;
	}
}


Also I have to have this in the header:

Code: ags

import function Exit_MouseMoveG();


and eventually the function is defined in the hotspod code like this:

Code: ags

function hZpetDoVestibulu_MouseMove()
{
Exit_MouseMoveD();
}


And... it works, so there is no problem... BUT it work only sometimes and sometimes the cursor stays changed... as you can see in this video:



sometimes the arrow down is kept and shows even in the inventory.

Any ideas how it could be fixed?

Thanks!

Pollux

Oh... so no one actually know?

Interesting... :)

Khris

It seems pretty clear that it's the GUI causing this;  Mouse.SaveCursorUntilItLeaves();  is not an ideal way of implementing custom cursors though anyway.
There are several existing threads about exit arrows, there's should be a relatively recent in this or the Advanced forum.

Pollux

a-HA!

If I understand correctly, the mouse.SaveCursorUntilItLeaves(); change cursor when hover over the hotspot and change it back to the previous one - however if the previous one is not the default one, but some other, it keeps the other.

Tha's what causes my cursor thing.

I need to find a better solution then!

SMF spam blocked by CleanTalk