me.Tile(x, y, gid, tileset)

new Tile(x, y, gid, tileset)

a basic tile object

Parameters:
Name Type Description
x Number

x index of the Tile in the map

y Number

y index of the Tile in the map

gid Number

tile gid

tileset me.TMXTileset

the corresponding tileset object

Extends

Members

flipped :Boolean

Global flag that indicates if the tile is flipped

flippedAD :Boolean

True if the tile is flipped anti-diagonally

flippedY :Boolean

True if the tile is flipped vertically

flipX :Boolean

True if the tile is flipped horizontally

points :Array.<me.Vector2d>

Array of points defining the Polygon
Note: If you manually change points, you must call recalcafterwards so that the changes get applied correctly.

Inherited From:

pos :me.Vector2d

origin point of the Polygon

Inherited From:

tileId :Number

tileId

tileset :me.TMXTileset

tileset

Methods

clone() → {me.Rect}

clone this rectangle

Returns:
me.Rect -

new rectangle

Inherited From:

contains(rect) → {boolean}

check if this rectangle contains the specified one

Parameters:
Name Type Description
rect me.Rect
Returns:
boolean -

true if contains

Inherited From:

containsPoint(x, y) → {boolean}

check if this rectangle contains the specified point

Parameters:
Name Type Description
x Number

x coordinate

y Number

y coordinate

Returns:
boolean -

true if contains

Inherited From:

containsPointV(point) → {boolean}

check if this Polygon contains the specified point

Parameters:
Name Type Description
point me.Vector2d
Returns:
boolean -

true if contains

Inherited From:

copy(rect) → {me.Rect}

copy the position and size of the given rectangle into this one

Parameters:
Name Type Description
rect me.Rect

Source rectangle

Returns:
me.Rect -

new rectangle

Inherited From:

equals(rect) → {boolean}

check if this rectangle is identical to the specified one

Parameters:
Name Type Description
rect me.Rect
Returns:
boolean -

true if equals

Inherited From:

getBounds() → {me.Rect}

returns the bounding box for this shape, the smallest rectangle object completely containing this shape.

Returns:
me.Rect -

this shape bounding box Rectangle object

Inherited From:

getIndices(a) → {me.Polygon}

returns a list of indices for all triangles defined in this polygon

Parameters:
Name Type Description
a Array.<Vector2d>

list of vector

Returns:
me.Polygon -

this Polygon

Inherited From:

getRenderable(settingsopt) → {me.Renderable}

return a renderable object for this Tile object

Parameters:
Name Type Attributes Description
settings Object <optional>

see me.Sprite

Returns:
me.Renderable -

a me.Sprite object

isFinite() → {boolean}

determines whether all coordinates of this rectangle are finite numbers.

Returns:
boolean -

false if all coordinates are positive or negative Infinity or NaN; otherwise, true.

Inherited From:

overlaps(rect) → {boolean}

check if this rectangle is intersecting with the specified one

Parameters:
Name Type Description
rect me.Rect
Returns:
boolean -

true if overlaps

Inherited From:

resize(w, h) → {me.Rect}

resize the rectangle

Parameters:
Name Type Description
w Number

new width of the rectangle

h Number

new height of the rectangle

Returns:
me.Rect -

this rectangle

Inherited From:

rotate(angle) → {me.Polygon}

Rotate this Polygon (counter-clockwise) by the specified angle (in radians).

Parameters:
Name Type Description
angle Number

The angle to rotate (in radians)

Returns:
me.Polygon -

Reference to this object for method chaining

Inherited From:

scale(x, yopt) → {me.Polygon}

Scale this Polygon by the given scalar.

Parameters:
Name Type Attributes Default Description
x Number
y Number <optional>
x
Returns:
me.Polygon -

Reference to this object for method chaining

Inherited From:

scaleV(v) → {me.Polygon}

Scale this Polygon by the given vector

Parameters:
Name Type Description
v me.Vector2d
Returns:
me.Polygon -

Reference to this object for method chaining

Inherited From:

setPoints(points) → {me.Rect}

resize the rectangle to contain all the given points coordinates.

Parameters:
Name Type Description
points Array.<me.Vector2d>

array of vector defining a shape

Returns:
me.Rect -

this shape bounding box Rectangle object

Inherited From:

setShape(x, y, w|points, hopt) → {me.Rect}

set new value to the rectangle shape

Parameters:
Name Type Attributes Description
x Number

position of the Rectangle

y Number

position of the Rectangle

w|points Number | Array

width of the rectangle, or an array of vector defining the rectangle

h Number <optional>

height of the rectangle, if a numeral width parameter is specified

Returns:
me.Rect -

this rectangle

Inherited From:

to2d() → {me.Polygon}

apply a 2d projection to this shape

Returns:
me.Polygon -

Reference to this object for method chaining

Inherited From:

toIso() → {me.Polygon}

apply an isometric projection to this shape

Returns:
me.Polygon -

Reference to this object for method chaining

Inherited From:

toPolygon() → {me.Polygon}

Returns a polygon whose edges are the same as this box.

Returns:
me.Polygon -

a new Polygon that represents this rectangle.

Inherited From:

transform(matrix) → {me.Polygon}

apply the given transformation matrix to this Polygon

Parameters:
Name Type Description
matrix me.Matrix2d

the transformation matrix

Returns:
me.Polygon -

Reference to this object for method chaining

Inherited From:

translate(x, y) → {me.Rect}

translate the rect by the specified offset

Parameters:
Name Type Description
x Number

x offset

y Number

y offset

Returns:
me.Rect -

this rectangle

Inherited From:

translateV(v) → {me.Rect}

translate the rect by the specified vector

Parameters:
Name Type Description
v me.Vector2d

vector offset

Returns:
me.Rect -

this rectangle

Inherited From:

union(rect) → {me.Rect}

merge this rectangle with another one

Parameters:
Name Type Description
rect me.Rect

other rectangle to union with

Returns:
me.Rect -

the union(ed) rectangle

Inherited From:

updateBounds() → {me.Rect}

update the bounding box for this shape.

Returns:
me.Rect -

this shape bounding box Rectangle object

Inherited From: