Created
October 2, 2012 21:46
-
-
Save jgranick/3823511 to your computer and use it in GitHub Desktop.
How to use nme.display.Tilesheet (NME recipe)
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.display.Sprite; | |
import nme.display.Tilesheet; | |
import nme.geom.Rectangle; | |
import nme.Assets; | |
public class TilesheetExample extends Sprite { | |
public function new () { | |
super (); | |
var tilesheet = new Tilesheet (Assets.getBitmapData ("example.png")); | |
tilesheet.addTileRect (new Rectangle (0, 0, 100, 100)); | |
tilesheet.addTileRect (new Rectangle (100, 0, 100, 100)); | |
tilesheet.drawTiles (graphics, [ 0, 0, 0, 100, 0, 1 ]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can't find Tilesheet under nme.display either, only browser.display and native.display...