AbsoluteMouse

Could you please add a note in AbsoluteMouse.setHotSpotOffset() that says that this is reset by setRenderState()?



I played around with the hotspots for different shapes and never saw the effect I was expecting. At least until I found out that setRenderState overwrites the hotspot. So in this order it works:

setRenderState(TextureState)

setHotSpotOffset()

Checked that in… though maybe a real solution is better, I'll leave that to irrisor :slight_smile:

That's rather strange. I would tend to change that (havn't looked into the code, yet). Any explanation why this behaviour is good?

from mouse.java:



 public RenderState setRenderState(RenderState rs) {

I would guess this was done to keep a valid hotspot.  If we could detect that one was specifically specified by the user and keep that, then it seems like that would be the ideal.

Most of the times the texture of a mouse cursor is not changed frequently. And if it is changed for animation, changing the hotspot is not desired. So what about this solution:

Initialize the hotspot with null, the first time it is queried it is set to the center of the texture if the hotspot is still null.

I changed the order and that works, but your suggestion would be better of course.