class openfl.display.Tilesheet

Available on all platforms

Class Fields

static var TILE_ALPHA:Int

static var TILE_BLEND_ADD:Int

static var TILE_RGB:Int

static var TILE_ROTATION:Int

static var TILE_SCALE:Int

static var TILE_TRANS_2x2:Int

Instance Fields

var nmeBitmap:BitmapData

@private

function new(inImage:BitmapData):Void

function addTileRect(rectangle:Rectangle, ?centerPoint:Point = null):Int

function drawTiles(graphics:Graphics, tileData:Array<Float>, ?smooth:Bool = false, ?flags:Int = 0, ?count:Int = -1):Void

Fast method to draw a batch of tiles using a Tilesheet * * The input array accepts the x, y and tile ID for each tile you wish to draw. * For example, an array of [ 0, 0, 0, 10, 10, 1 ] would draw tile 0 to(0, 0) and * tile 1 to(10, 10) * * You can also set flags for TILESCALE, TILEROTATION, TILERGB and * TILEALPHA. * * Depending on which flags are active, this is the full order of the array: * * [ x, y, tile ID, scale, rotation, red, green, blue, alpha, x, y ... ] * *

graphics

The native.display.Graphics object to use for drawing *

tileData

An array of all position, ID and optional values for use in drawing *

smooth

(Optional) Whether drawn tiles should be smoothed(Default: false) *

flags

(Optional) Flags to enable scale, rotation, RGB and/or alpha when drawing(Default: 0)

function getTileCenter(index:Int):Point

function getTileRect(index:Int):Rectangle

function getTileUVs(index:Int):Rectangle