Please, give us Bigger and High Contrast Mouse Cursors!

Thank you for that discussion. What confuses me though is this statement:

Isn’t OnMouseEnter and OnMouseExit evaluated at runtime?. Is it really inlined by the compiler and static (it’s a public method inherited from MonoBehaviour and a public field cursorTexture. The C# compiler itself can’t inline it. So it would need to happen with Unity especially)? That would really be surprising.

That was me already getting tired of the discussion (there have been a few long ones over the years) and not explaining myself properly.

Both methods are evaluated at runtime, but using Cursor.SetCursor (with a cursor variable) is what causes performance issues. When you have the cursor embedded during build and assigned to the layout, there’s no evaluation required.
Basically, using the cursor as a variable and assigning it dynamically leads to huge lag/disconnect between where the mouse actually is and where the game thinks it is.

There are probably ways around this, especially for smaller games, but for a game as “busy” as LE is, it’s way harder to implement a clean solution for this.

It’s something even Mike has replied to saying they wish they could do it but there isn’t a clean solution yet.
If they could, they definitely would, as this would be both an easy win (everyone would love it) and an opportunity to sell cursor MTX as well, like PoE does.

1 Like

Got it. Thanks for elaborating. I understand it then that EHG likely overwrote the default system cursor or something and is not using SetCursor because of its performance issues.

I don’t know the actual code they’re using, but it’s safe to assume that, based on how Unity works and on previous statements by Mike. The most likely implementation is that their custom cursors are assigned to the layout/renders natively and it then uses the embedded resources after build.
So there’s no decision making involved because it’s part of the layout/render definition.

That being said, I could be totally wrong on how they did it. It’s been a long time since I dabbled with Unity (never really liked it much, personally, but I only dabbled for idle fun) and things could be different by now. But back then, iirc (it has been quite a few years), you basically decided which cursor you wanted to use on which layout and Unity did things on its own. I’m not sure if there even was a dynamic option back then.

1 Like