Commits

josemaria.alkala committed fca3449

Clutter animation

  • Participants
  • Parent commits 30a46e3

Comments (0)

Files changed (3)

File clutter_animation.rst

+Clutter: animation
+==================
+
+Simple implicit animations
+--------------------------
+
+It is very easy to get something animated. For an actor we might use something like::
+
+  _actor_anim = _actor.animatev(
+                   Clutter.AnimationMode.EASE_OUT_BOUNCE,
+                   1500,
+                   ["x"], 
+                   [20] )
+
+where:
+
+* EASE_OUT_BOUNCE: this is the effect of the animation
+* 1500 represents how long will be animated in milliseconds.
+* ["x"]: this is a list with the elements that will be animated.
+* [20]: means that at the end of the animation, "x" will be equal to 20.
+
+Full example
+^^^^^^^^^^^^
+
+Using this base we could write::
+
+  #!/usr/bin/env python
+  #! -*- coding: utf-8 -*-
+
+  from gi.repository import Clutter
+  import sys
+
+  if __name__ == '__main__':
+      Clutter.init( sys.argv )
+
+      # Create Stage
+      _stage = Clutter.Stage()
+      _stage.set_title( "Basic Usage" )
+      _stage.set_size( 400, 200 )
+
+      # Create Actor
+      _red = Clutter.Color().new(255, 0, 0, 255) # R,G,B,alpha
+      _actor = Clutter.Text().new_full( 
+		    "Mono 10", 
+		    "Hello World!", 
+		    _red )
+
+      _actor.set_position( 100,100 )
+      _actor_anim = _actor.animatev(
+                       Clutter.AnimationMode.EASE_OUT_BOUNCE,
+                       1500,
+                       ["x"], 
+                       [20] )                  
+
+      # Add Actor to the Stage
+      _stage.add_actor( _actor )
+      _stage.connect("destroy", lambda w: Clutter.main_quit() )    
+      _stage.show_all()
+
+      Clutter.main()
+
    basic_usage
    clutter_key_events
    clutter_json
+   clutter_animation
 
    resources
 

File resources.rst

 Resources
 =========
 
+`How everything fits together <https://mail.gnome.org/archives/gtk-devel-list/2011-August/msg00058.html>`_
+
 Clutter
 -------
 
 * `Cookbook <http://docs.clutter-project.org/docs/clutter-cookbook/1.0/>`_
 * `Reference Manual <http://developer.gnome.org/clutter/stable/>`_
+* `Basic old tutorial <http://www.majorsilence.com/blog_python_clutter_introduction>`_
 * `Wiki <http://wiki.clutter-project.org/wiki/Main_Page>`_
 * `Example <http://wiki.clutter-project.org/wiki/ExamplePython>`_
 * `Old but complete examples <https://github.com/pmarti/clutter-tutorial/tree/master/examples>`_
+* `A little bit of COGL <http://www.daniweb.com/software-development/python/threads/346767/programming-using-pyclutter>`_
+* `Old but well structured tutorial <http://www.modrana.org/pyclutter_tutorial/tutorial/html/index.html>`_
+* `Similar source reference <http://www.modrana.org/pyclutter_marti/index.html>`_
+* `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/>`_
 
-