Hi; On Wed, 2008-02-27 at 13:42 +0100, Murray Cumming wrote: > On Tue, 2008-02-26 at 17:28 +0000, Matthew Allum wrote: > > So clutter has 2 painting modes - the regular one you see and the > > picking one - which essentially just renders offscreen per reactive > > actor color coded silhouettes (usually just quads) of actors so it can > > quickly figure out what actor a pointer event relates to. Thats > > basically what the above is doing though Im not sure why we are checking > > the mapped flag - that probably isn't needed - pippin, ebassi ? > > > Thanks. I'd really like some more clues about this because I hate to > write about something I don't understand. I understand that all > containers must call clutter_actor_pick() on all their children(), > but I don't understand what regular actors should do in their > ClutterActor::pick(): implementation. > > Most of the pick() implementations in core clutter just use the default > implementation in ClutterActor, which draws a rectangle. I can't find > any non-container pick() implementation in clutter or tidy that doesn't > use that.
Right, because its usually enough. A shaped alpha texture could probably paint something a little more (but hasn't really been a problem so far) > > Below are some more that I found in Tidy, but I don't see a pattern yet, > so I don't see what they are actually trying to achieve. If this is just > for some kind of cursor-is-inside-the-shape detection then why is the > color significant? Why do some just call their paint() function instead > of drawing an outline? > Every Clutter actor has a globally unique ID. When picking this ID is converted to a color and passed to the actor. The actor then paints its silhouette in *just* this color and offscreen. When a paint is complete the pixel is read back from this offscreen framebuffer at the location required (i.e where the pointer event was) its color is then converted back to an ID and then viola a lookup and we can get the actor the pointer event was for. == Matthew -- To unsubscribe send a mail to [EMAIL PROTECTED]
