System Preferences "halo/spotlight" effect
System Preferences "halo/spotlight" effect
- Subject: System Preferences "halo/spotlight" effect
- From: "John C. Daub" <email@hidden>
- Date: Fri, 13 Feb 2009 06:51:51 -0600
- Thread-topic: System Preferences "halo/spotlight" effect
Hello.
In Leopard's System Preferences application, when you type into the search
field in the toolbar it presents a list of helpful keywords. In addition,
the content area of the window dims and a halo/spotlight effect appears over
each icon that is a possible match for what's being typed.
I'm trying to replicate that overlay halo/spotlight behavior, in a similar
sort of window (window full of icons). I'm seeking guidance in how to
achieve this.
I'm figuring in System Preferences it's using an overlay window, but since
my content scrolls I cannot use a window and must use an NSView. I did find
-[NSView addSubview:positioned:relativeTo:], which helped me position my
"halo view" atop my contents, and I have been fiddling around with various
things trying to accomplish the effect but I can't quite get there. I do see
within System Preferences.app/Contents/Resources/ a spotlight.tif and
spotlightdim.tif which provide the halo masking, and I experimenting with
rendering copies of those TIFF's via
-drawAtPoint:fromRect:operation:fraction: within my -[HaloView drawRect:]
and I could sorta get things to work with a fraction of 0.5. But that just
gives me the halo. I'm struggling to get the fill over the full content
area, that then doesn't affect the halo areas.
So I'm just looking for pointers on how to accomplish this. Am I just
overlooking the right combination of fills, strokes, alpha, NSBezierPath's,
and compositing? Do I need to look at OpenGL (never used it before)? Core
Image? Would things like -[NSView contentFilters] help me here? Never used
them before, tho I'm reading documentation. Some other approach entirely? In
all my years of programming I've never had to do a graphical effect like
this so I'm a little lost as to the direction to go.
Thank you for your assistance.
--
John C. Daub }:-)>=
<mailto:email@hidden> <http://www.hsoi.com/hsoi/blog/>
"You can believe you can, or you can believe you can't; either way you will
be correct." -- Henry Ford.
_______________________________________________
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