Jump to content

Custom cursor broken?


Recommended Posts

Inside the default template there is code to define a custom default cursor that you can modify.


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?

Link to comment
Share on other sites

  • 1 year later...

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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...