Highlight Layer on Mouseover
Highlight Layer on Mouseover
- Subject: Highlight Layer on Mouseover
- From: Mike Rossetti <email@hidden>
- Date: Sat, 05 Jul 2008 21:35:14 -0600
I've been putting together a drawing package using layers and having a
terrific time! But I'd appreciate a bit of guidance on the
recommended approach for highlighting a layer as the mouse moves over
the layer. This is intended to give the user positive feedback as to
which drawing element the mouse is actually hovering over. There is a
bezier path describing the boundaries of the drawing object. A nice
bloom highlight around the boundaries of the path would be perfect.
Perhaps it could even have a mild 'throb'.
Obviously, the containing view has to handle the mouse movement
detection--layers don't get events. At first I was thinking the view
could set a 'hovering' property on the layer and have an action take
care of the animation but then realized that actions are probably most
appropriate for transitions, and this is more of a 'state'.
Currently, I'm thinking that the master view would just tell the
appropriate layer (a specialization of CALayer) that's it's being
hovered and the layer would add the highlighting (probably a sublayer
with a copy of the bezier path which is simply drawn). Alternately,
the view could just add the sublayer and let it determine its
superlayer's path.
Is this the right approach or is there a better way?
Thanks,
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden