Drawing in GNOME using cairo, reusing graphics class from project hamster.
All the files in root folder are working experiments that you can run from
console.
The graphics helper library is in lib/ folder.
Read some docs,
here’s the hamster.
- base.py – base template for absolute minimum to start drawing. Use it to write your experiments
- hello.py – slightly extended code from the tutorial
- easing_demo.py – demos all the easing functions
- pie_menu.py – perhaps the best of the demos demoing sprite nesting
- tween_chain.py – tweeners chasing each other’s tail
- waypoints.py – an experiment with boids (see flocking.py). Let it run for a minute to see how it works. An extended version of this can be found in the waypoints repository
- blur.py – shows that software blur is a no-go with current Python and get/put pixel bindings
- bubblewrap.py – many strokes and fills result in slow performance
- flocking.py, flocking2.py – flocking algorithm ported from processing. The second iteration optimizes code, but still it’s kind of shame how big the performance difference is between this code and the processing’s Java one.
- drop_shadow.py – an idea to prerender an effect and then keep it in memory. Pretty much how ActionScript filters work.
- hamster_*.py – experiments that make use of hamster API
You may use hamster graphics helper library and the experiments under the terms
of either the MIT License or the GNU General Public License (GPL) Version 2.
The MIT License is recommended for most projects. It is simple and easy to
understand and it places almost no restrictions on what you can do with hamster
graphics and the experiments.
If the GPL suits your project better you are also free to use hamster graphics
and experiments under that license.
You don’t have to do anything special to choose one license or the other and you
don’t have to notify anyone which license you are using.
You are free to use hamster graphics and experiments in commercial projects as
long as the copyright header is left intact.