Cursor

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Cursor

Post by Cleves »

Hey all,

I wanted to ask if there is anyway to change my cursor to a custom one i made?

Thanks
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

You will need to add these lines to your WinMain function:

Code: Select all

WNDCLASS wcex;
wcex.hCursor = LoadCursor(NULL, "YOUR_CURSOR_FILE_NAME.cur");
then you create a new resource script file in your project and add the cursor to it and then a resource.h file and add it to the project. This works in MS VC++6, if you're using Dev C++ then I don't know what to do.
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

BTW, you do the same thing to add an icon to your project that will show up on the executable file. Except you do a

Code: Select all

wcex.hIcon = LoadIcon(NULL, "YOUR_ICON_FILE_NAME.ico");
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

I use main and not winmain but that's not a problem but what i want to ask is if i can do it using the Irrlicht engine?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Not yet. :(
You could make the cursor invisible, and draw a sprite at the position of your cursor in your drawing loop, but that's a little but unconfortable with windowed applications and applications with low fps.
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

Would this option be available in 0.5? :lol:
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

It is already an option in 0.41.

Code: Select all

//do this once
device->getCursorControl()->setVisible(false);
video::ITexture* myCursorPic= driver->getTexture("../../media/2ddemo.bmp");
core::rect<s32> cursorRect(1,1,32,32);

//do this in your draw loop - psuedocode used for locations
driver->draw2DImage(myCursorPic, core::position2d<s32>(CursorLoc.X,CursorLoc.Z), cursorRect, 0, video::SColor(255,255,255,255), true);
Tutorial 6 has more info on 2D graphics and has a good way of making an animated cursor.
Crud, how do I do this again?
Post Reply