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 changepoints
, you must callrecalc
afterwards 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
- 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
- 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.
- 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
- 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
-
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
- Inherited From:
-
rotate(angle, vopt) → {me.Polygon}
-
Rotate this Polygon (counter-clockwise) by the specified angle (in radians).
Parameters:
Name Type Attributes Description angle
Number The angle to rotate (in radians)
v
me.Vector2d | me.ObservableVector2d <optional>
an optional point to rotate around
- 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 - Inherited From:
-
scaleV(v) → {me.Polygon}
-
Scale this Polygon by the given vector
Parameters:
Name Type Description v
me.Vector2d - 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
- 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
- Inherited From:
-
to2d() → {me.Polygon}
-
apply a 2d projection to this shape
- Inherited From:
-
toIso() → {me.Polygon}
-
apply an isometric projection to this shape
- Inherited From:
-
toPolygon() → {me.Polygon}
-
Returns a polygon whose edges are the same as this box.
- Inherited From:
-
transform(matrix) → {me.Polygon}
-
apply the given transformation matrix to this Polygon
Parameters:
Name Type Description matrix
me.Matrix2d the transformation matrix
- 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
- Inherited From:
-
translateV(v) → {me.Rect}
-
translate the rect by the specified vector
Parameters:
Name Type Description v
me.Vector2d vector offset
- Inherited From:
-
union(rect) → {me.Rect}
-
merge this rectangle with another one
Parameters:
Name Type Description rect
me.Rect other rectangle to union with
- Inherited From:
-
updateBounds() → {me.Rect}
-
update the bounding box for this shape.
- Inherited From: