Class: TMXOrthogonalRenderer

me. TMXOrthogonalRenderer

new TMXOrthogonalRenderer(cols, rows, tilewidth, tileheight)

an Orthogonal Map Renderder
Parameters:
Name Type Description
cols Number width of the tilemap in tiles
rows Number height of the tilemap in tiles
tilewidth Number width of each tile in pixels
tileheight Number height of each tile in pixels
Source:
TMXRenderer.js, line 151

Extends

Methods

canRender(component) → {boolean}

return true if the renderer can render the specified layer
Parameters:
Name Type Description
component me.TMXTileMap | me.TMXLayer TMX Map or Layer
Inherited From:
Source:
TMXRenderer.js, line 46
Returns:
Type
boolean

drawTile(renderer, x, y, tile)

draw the given tile at the specified layer
Parameters:
Name Type Description
renderer me.CanvasRenderer | me.WebGLRenderer a renderer object
x Number X coordinate where to draw the tile
y Number Y coordinate where to draw the tile
tile me.Tile the tile object to draw
Inherited From:
Source:
TMXRenderer.js, line 113

drawTileLayer(renderer, layer, rect)

draw the given TMX Layer for the given area
Parameters:
Name Type Description
renderer me.CanvasRenderer | me.WebGLRenderer a renderer object
layer me.TMXLayer a TMX Layer object
rect me.Rect the area of the layer to draw
Inherited From:
Source:
TMXRenderer.js, line 126

pixelToTileCoords(x, y, vector) → {me.Vector2d}

return the tile position corresponding to the specified pixel
Parameters:
Name Type Argument Description
x Number X coordinate
y Number Y coordinate
vector me.Vector2d <optional>
an optional vector object where to put the return values
Inherited From:
Source:
TMXRenderer.js, line 63
Returns:
Type
me.Vector2d

pixelToTileX(x) → {Number}

return the tile position corresponding for the given X coordinate
Parameters:
Name Type Description
x Number X coordinate
Inherited From:
Source:
TMXRenderer.js, line 91
Returns:
tile vertical position
Type
Number

pixelToTileY(y) → {Number}

return the tile position corresponding for the given Y coordinates
Parameters:
Name Type Description
y Number Y coordinate
Inherited From:
Source:
TMXRenderer.js, line 102
Returns:
tile horizontal position
Type
Number

tileToPixelCoords(col, row, vector) → {me.Vector2d}

return the pixel position corresponding of the specified tile
Parameters:
Name Type Argument Description
col Number tile horizontal position
row Number tile vertical position
vector me.Vector2d <optional>
an optional vector object where to put the return values
Inherited From:
Source:
TMXRenderer.js, line 77
Returns:
Type
me.Vector2d
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.