Created
March 9, 2013 17:24
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<project> | |
<!-- ... --> | |
<window antialiasing="4" /> <!-- For smooth rendering on native targets (flash target is already antialiased) --> | |
<!-- ... --> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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