Changing the mouse image
I have an inventory window full of textured quads(originally stored in png files)representing items, weapons, etc..
I want the mouse to become an image of whatever item the player clicks on in the inventory window.
I've looked over a lot of documentation but am still very unsure as to the simplest way to go about this, anyone have any experience with this?
I want the mouse to become an image of whatever item the player clicks on in the inventory window.
I've looked over a lot of documentation but am still very unsure as to the simplest way to go about this, anyone have any experience with this?
Didn't you ask this before?
It's dead easy with NSCursor.
It's dead easy with NSCursor.
I asked it before but the conversation took some kind of turn.
Anyone have any ideas?
I told you, NSCursor... you were told NSCursor last time too... is there a problem?
I kind of already knew that I need to use NSCursor. But how would I assemble an NSImage (for NSCursor) from the pixel array(I'm assuming i'd do this as opposed to reading directly from a png file) stored in my texture struct?
Leroy Wrote:But how would I assemble an NSImage (for NSCursor) from the pixel array(I'm assuming i'd do this as opposed to reading directly from a png file) stored in my texture struct?
If you want to read them from the files, that's just as easy.
Code:
NSCursor * cursor;
[cursor initWithImage:[NSImage imageNamed:@"zomgcursor"]];
[cursor set];I didn't test this at all.
You probably need some retain crap in there or something. I forgot all of that the day that Leopard was released.
I'd just load an NSImage from a file, if you've got a file handy.

