svg support for cocos
Here a library to handle svg content in cocos.The core functionality comes from squirtle, but it offers friendly CocosNodes to handle svg files.
Usage is not so much different from a sprite.
Squirtle examples translated.
Docs specific to cocos in the readme and docstrings.
I know Im very late, but usage will be totally evident to cocos users.
So...can I use it in this pyweek?
Note to gl users not in cocos or pyglet: if you want svg support, look at the file squirtle_core.py; it encapsulates the conversion svg file ---> vertex list without references to pyglet or cocos, using that you can roll your own adaptor.
edit: the link is
http://groups.google.com/group/cocos-discuss/web/squirtle_mod.zip
edit:
http://groups.google.com/group/cocos-discuss/web/squirtle_mod_bugfix1.zip
fixes one windows style path in the examples for compatibility with *nix
fixes a traceback while leaving a scene
Thanks Alia for the bugfix.
edit: new bugfix
http://groups.google.com/group/cocos-discuss/web/squirtle_mod_bugfix2.zip
Thanks Alia for the bugreport.
(log in to comment)
Comments
http://groups.google.com/group/cocos-discuss/web/squirtle_mod_bugfix2.zip
Changelog:
The user interface will not change until after pyweek.
Some bugfixes and svg-compatibility upgrades can be released.
I will repost any bugfix in the page
http://groups.google.com/group/cocos-discuss/files
look at a name in the form squirtle_mod_bugfixX.zip
Also will announce in this thread.
release 0.2: squirtle_mod_bugfix2.zip
fixes a glicth related to error reporting
fixes a bug in arcs ( I missed some squirtle update )
fixes another bug in arcs ( sol: clamp before acos in arc_to )
fixes traceback when svg elements width and height includes units (cm, mm, etc)
upgraded converter, now understands path opcodes 'm' and 'a'. this prevented
some parts in za_xxx.svg files to show. Thanks Alia for the svgs.
Also opcodes 'a', 'c', 'm' now understands the 'repeat' use. (probably need
to port to other opcodes)
minor upgrade: now color expressed as svg color constants are accepted. You can see the know constants in svg_colors.py.
richard on 2009/08/05 22:13:
"here" being where? :)