Changing the mouse image

Member
Posts: 105
Joined: 2007.03
Post: #1
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Didn't you ask this before?

It's dead easy with NSCursor.
Quote this message in a reply
Member
Posts: 105
Joined: 2007.03
Post: #3
I asked it before but the conversation took some kind of turn.
Quote this message in a reply
Member
Posts: 105
Joined: 2007.03
Post: #4
Anyone have any ideas?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
I told you, NSCursor... you were told NSCursor last time too... is there a problem?
Quote this message in a reply
Member
Posts: 105
Joined: 2007.03
Post: #6
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?
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Member
Posts: 283
Joined: 2006.05
Post: #8
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #9
I'd just load an NSImage from a file, if you've got a file handy.
Quote this message in a reply
Post Reply