views:

65

answers:

2

I'd like to be able to display a quick animated "flash" around the mouse cursor (similar to the effect in some screen-recording applications). What would be a good way to go about this?

My current idea is to display a temporary, floating, transparent window window under the mouse position, animate it, then hide it. But I'm wondering if there are any better suggestions?

+1  A: 

This idea is your best bet. While it's not exactly what you're looking for, my JLNDragEffectManager (morphing images while dragging) demonstrates one approach to the "borderless window following the mouse".

The difference is it looks like you're not interested merely in drag events, but rather "anywhere the mouse is." You can always get the current mouse location by asking NSEvent for the -mouseLocation (given in screen coordinates).

Joshua Nozzi
+1  A: 

Another option is to use an animated mouse cursor. Then just use [NSCursor set].

I'm not sure how to create an animated cursor though.

When you drag an app from the dock it does the "poof" affect. I think Apple achieved this by creating a borderless window and playing an animation in that window.

Leibowitzn