Duion Posted June 9, 2017 Posted June 9, 2017 Inside the default template there is code to define a custom default cursor that you can modify.https://github.com/GarageGames/Torque3D/blob/c83efa59e0a11fc15c68afaf106807643191ac6f/Templates/Full/game/core/scripts/gui/cursors.cs#L34-L38I 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? Quote
Hodo33 Posted May 14, 2019 Posted May 14, 2019 I recall in the past I had to add overrideplatformcursor = true in guicanvas.cpp and h I will see if I can find the codeend of guiCanvas.h add thisprotected: bool mOverridePlatformCursor; public: void overridePlatformCursor( bool state = true ) { mOverridePlatformCursor = state; } end of guiCanvas.cpp add thisConsoleMethod( 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 thisif (isObject(Canvas)) Canvas.overridePlatformCursor(true); return true;in script cursors.cs add the new cursornew 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 cursorfunction MEvent::onMouseEnter(%this,%b,%point,%m){ Canvas.setCursor("CrosshairCursor");}Hope this helps... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.