Create a gist now

Instantly share code, notes, and snippets.

Example SVG rendering in Haxe/NME. Because I will forget how to do this later.
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- ... -->
<window antialiasing="4" /> <!-- For smooth rendering on native targets (flash target is already antialiased) -->
<!-- ... -->
</project>
import nme.Assets;
import nme.display.Shape;
import nme.display.Sprite;
import format.SVG;
class SVGExample extends Sprite
{
var svg:SVG;
var shape:Shape;
public function new()
{
svg = new SVG(Assets.getText("nme.svg"));
shape = new Shape();
svg.render(shape.graphics);
addChild(shape);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment