josemaria.alkala avatar josemaria.alkala committed 14f75c7

Animator: not working

Comments (0)

Files changed (2)

clutter_animation.rst

 
       Clutter.main()
 
+Currently this code fails complaining of::
+
+  (anim_states.py:12376): Clutter-CRITICAL **: clutter_interval_set_final_value: assertion `G_VALUE_TYPE (value) == priv->value_type' failed
+  /usr/lib/python3.2/site-packages/gi/types.py:43: Warning: g_value_set_float: assertion `G_VALUE_HOLDS_FLOAT (value)' failed
+    return info.invoke(*args, **kwargs)
+  /usr/lib/python3.2/site-packages/gi/types.py:43: Warning: g_value_get_float: assertion `G_VALUE_HOLDS_FLOAT (value)' failed
+    return info.invoke(*args, **kwargs)
+
+Animator
+--------
+
+The reference documentation for the `animator <http://developer.gnome.org/clutter/1.10/ClutterAnimator.html>`_.
+
+Not working for me yet::
+
+  #!/usr/bin/env python
+  #! -*- coding: utf-8 -*-
+
+  from gi.repository import Clutter
+  import sys
+
+  def keyPress(self, event, _anim):
+      _anim.start()
+
+  if __name__ == '__main__':
+      Clutter.init( sys.argv )
+
+      # Create Stage
+      _stage = Clutter.Stage()
+      _stage.set_title( "Animation using states" )
+      _stage.set_size( 400, 400 )
+      _stage.set_reactive( True )
+
+      # Create Actor
+      _red = Clutter.Color().new(255, 0, 0, 255) # R,G,B,alpha
+      _actor = Clutter.Text().new_full( 
+		    "Mono 10", 
+		    "Press any key...", 
+		    _red )
+
+      _actor.set_position( 100.0,100.0 )
+
+      # Transition
+      # - State creation
+      _anim = Clutter.Animator()
+      _anim.set_duration( 4000 )
+      #_anim.set_properties(
+	 # start of the animation
+      #   _actor, "x", Clutter.AnimationMode.LINEAR, 0.0, 0.0,
+
+	 # half-way
+      #   _actor, "x", Clutter.Animation.LINEAR, 0.5, 100.0,
+
+	 # end of animation
+      #   _actor, "x", Clutter.Animation.LINEAR, 0.5, 100.0,
+      #   )
+
+      _anim.set_key( _actor, "x", Clutter.AnimationMode.LINEAR, 0.0, 50.0)
+
+	 # half-way
+	 #     _actor, "x", Clutter.Animation.LINEAR, 0.5, 100.0,
+
+	 # end of animation
+	 #    _actor, "x", Clutter.Animation.LINEAR, 0.5, 100.0,
+	 #    )       
+      # - Defines de behaviour of a number of actors 
+
+	 #          pre_delay=0.0, post_delay=0.0)
+
+      # - All state transitions take 250ms
+      #    _transitions.set_duration(None,None,3000) 
+
+      # Add Actor to the Stage
+      _stage.add_actor( _actor )
+      _stage.connect("destroy", lambda w: Clutter.main_quit() )    
+      _stage.connect('key-press-event', keyPress, _anim)
+
+      _stage.show_all()
+
+      # Create animation
+
+
+      Clutter.main()
+
 * `Rounded circle with COGL <http://www.themacaque.com/wiki/doku.php?id=clutter:rounded_rectangle>`_
 * `Container example <http://www.modrana.org/pyclutter_tutorial/tutorial/html/custom-container-example.html>`_
 * `Those who REALLY knows <http://blogs.gnome.org/ebassi/>`_
+* `Texture <http://www.mail-archive.com/clutter-app-devel-list@clutter-project.org/msg00484.html>`_
 
+
+Mx
+--
+
+* `Vala example <http://live.gnome.org/Vala/MxSample>`_
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.