Game Development Community

Can't change cursor bitmap

by Amjad Yahya · in Torque 2D Beginner · 06/21/2013 (6:29 am) · 25 replies

I'm trying to change the cursor bitmap with no luck.

in main.cs which resides in myGame/modules/Game folder I wrote the following code:
new GuiCursor(DefaultCursor)
	{
		hotSpot = "1 1";
		renderOffset = "0 0";
		bitmapName = "./assets/images/defaultCursor.png";
	};
	canvas.setCursor(DefaultCursor);

cursor image file resides here: myGame/modules/Game/assets/images

Am I missing something?
Page«First 1 2 Next»
#21
09/17/2013 (6:07 am)
@Simon: sorry it took me too long to reply but I just had the chance to test on OSX, all is OK except I can't hide the Mac default cursor, it's always there on top of the custom cursor.
#22
09/17/2013 (7:17 am)
No prob, Amjad.

Since the changes I have made basically interrupt Windows messages, I don't expect it works on OSX. I assume that the same changes would need to be made in the OSX-specific code which catches the platform events.

In theory, you could even keep the same variable and simply copy the verification over to the OSX code; the foundation is there.
#23
09/17/2013 (8:22 am)
I couldn't find the corresponding code for osx but the closest that I came to is this code in osxInput.mm, I don't know what to do next though, I hope someone sees this and fixes it.
//------------------------------------------------------------------------------
// Not yet implemented. Will resolve in the next platform update
void Input::pushCursor(S32 cursorID)
{
}

//------------------------------------------------------------------------------
// Not yet implemented. Will resolve in the next platform update
void Input::popCursor()
{
}

//-----------------------------------------------------------------------------
// Not yet implemented. Will resolve in the next platform update
void Input::refreshCursor()
{
}
#24
10/14/2018 (11:09 am)
Hi folks,

thank you. Is there any chance to mpleent this in an Update of the engine?
This is really important.

Thanks, Richard
#25
10/15/2018 (8:51 am)
@ChrisKnapp - Torque 2D MIT is not currently in active development. You will have to implement any features you want.
Page«First 1 2 Next»