clutter_actor_move_by
clutter_actor_set_rotation
clutter_actor_get_rotation
+clutter_actor_is_rotated
clutter_actor_set_opacity
clutter_actor_get_opacity
clutter_actor_set_name
clutter_actor_get_depth
clutter_actor_set_scale
clutter_actor_get_scale
+clutter_actor_is_scaled
clutter_actor_get_abs_size
clutter_actor_apply_transform_to_point
clutter_actor_transform_stage_point
+clutter_actor_apply_relative_transform_to_point
<SUBSECTION>
ClutterVertex
clutter_actor_get_vertices
+clutter_actor_get_relative_vertices
+clutter_actor_box_get_from_vertices
<SUBSECTION>
clutter_actor_set_anchor_point
<programlisting>
A few FIXMES:
- - note use of units in sizing
- more on composite/container actors, when/why to use...
+ implementaing a composite actor - set_parent() etc
+ implementing a container - interface etc
- Painting
- + note transform already applied. (including position, scale etc)
+ note on cogl_enable if painting texture or blended item
(should at least call cogl_enable(0) - to reset state cache)
+ fine to use regular GL but then wont be portable
each visible child. Remember: the returned coordinates must be relative
to the parent actor.</para>
+ <note>All the coordinates are expressed using #ClutterUnit<!-- -->s,
+ the internal high-precision unit type, which guarantee sub-pixel
+ precision. #ClutterUnit has the same limitation that #ClutterFixed
+ has, see the <link linkend="clutter-Fixed-Point-Support">fixed point page</link>.</note>
+
<example id="clutter-actor-query-coords-example">
<para>This example shows how an actor class should override the
query_coords() virtual function of #ClutterActor. In this case,
{
FooActor *foo_actor = FOO_ACTOR (actor);
GList *child;
+
+ /* Clutter uses high-precision units which can be converted from
+ * and into pixels, typographic points, percentages, etc.
+ */
ClutterUnit width, height;
/* initialize our size */
{
ClutterActor *child_actor = child->data;
- /* we return only visible actors */
+ /* we consider only visible actors */
if (CLUTTER_ACTOR_IS_VISIBLE (child_actor))
{
ClutterActorBox child_box = { 0, };
or composite actors with internal children should do the same, and call
clutter_actor_paint() on every visible child:</para>
+ <para>When inside the ClutterActor::paint() method the actor is already
+ positioned at the coordinates specified by its bounding box; all the
+ paint operations should then take place from the (0, 0) coordinates.</para>
+
<example id="clutter-actor-paint-example">
<programlisting>
static void
FooActor *foo_actor = FOO_ACTOR (actor);
guint width, height;
+ /* it is possible to avoid a costly paint by checking whether the
+ * actor should really be painted in pick mode
+ */
+ if (!clutter_actor_should_pick_paint (actor))
+ return;
+
/* by including <clutter/cogl.h> it's possible to use the internal
* COGL abstraction API, which is also used by Clutter itself and avoids
* changing the GL calls depending on the target platform (GL or GL/ES).
clutter_actor_get_size (actor, &width, &height);
+ /* it is also possible to use raw GL calls, at the cost of losing
+ * portability
+ */
glEnable (GL_BLEND);
/* draw a triangular shape */
</programlisting>
</example>
+ <para></para>
+
</chapter>