Custom cursor broken?

Scripting questions, discussions, etc
2 posts Page 1 of 1
Posts: 1598
Joined: Sun Feb 08, 2015 1:51 am
  by Duion » Fri Jun 09, 2017 1:09 pm
Inside the default template there is code to define a custom default cursor that you can modify. ... cs#L34-L38
I tried adding a custom graphic for the cursor, but I noticed that the custom cursor is never loaded, the game will always use the default windows cursor.

So how can I make it work? Or is it never used or cannot work? If so can I delete it?
Posts: 104
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Tue May 14, 2019 5:56 pm
I recall in the past I had to add
overrideplatformcursor = true in guicanvas.cpp and h I will see if I can find the code

end of guiCanvas.h add this

bool mOverridePlatformCursor;
void overridePlatformCursor( bool state = true )
mOverridePlatformCursor = state;

end of guiCanvas.cpp add this

ConsoleMethod( GuiCanvas, overridePlatformCursor, void, 2, 3, "(value=true)" )
bool value = true;
if( argc > 2 )
value = dAtob( argv[ 2 ] );
object->overridePlatformCursor( value );

in game script files main.cs at the end of createCanvas add this

if (isObject(Canvas))
return true;

in script cursors.cs add the new cursor
new GuiCursor(CrossHairCursor)
hotSpot = "8 8";
renderOffset = "0 0";
bitmapName = "core/art/gui/images/crosshair_white";

then any time in game script you want a different cursor

function MEvent::onMouseEnter(%this,%b,%point,%m)

Hope this helps...
2 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest