Skip to content

Instantly share code, notes, and snippets.

@ambethia
Created March 9, 2013 17:24
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ambethia/5124913 to your computer and use it in GitHub Desktop.
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