Event before the mouse cursor is rendered?

Started by Gurok, Fri 31/10/2014 03:40:50

Previous topic - Next topic

Gurok

I have a repeatedly_execute_always function that handles changing mouse cursors as the player moves his/her mouse around the screen. e.g. When the mouse is near an exit, it changes to an arrow. When it is over a hotspot, it animates with a glow. I think this is pretty standard and there are quite a few modules that do similar things.

I've noticed that AGS seems to process a frame in this order:
1. Update mouse x/y position
2. Render screen + mouse cursor
3. Process events

My problem is that when I change the mouse cursor to reflect the player hovering over an exit or a hotspot, it doesn't get shown until then next frame. That means there's always one frame of the previous cursor shown in the wrong place.

Is there a way to run an event before the screen+mouse are rendered? Alternatively, is there a way to force the mouse cursor to be redrawn after processing events like repeatedly_execute_always?
[img]http://7d4iqnx.gif;rWRLUuw.gi

Snarky

Have you tried running Mouse.Update() at suitable points in your method? I seem to remember that fixing similar problems for me.

Gurok

[img]http://7d4iqnx.gif;rWRLUuw.gi

SMF spam blocked by CleanTalk