me.Pointer()

new Pointer()

a pointer object, representing a single finger on a touch enabled device.

Extends

Members

static button :Number

the button property indicates which button was pressed on the mouse to trigger the event.

See:

static clientX :Number

the horizontal coordinate within the application's client area at which the event occurred

See:

static clientY :Number

the vertical coordinate within the application's client area at which the event occurred

See:

static event :PointerEvent|TouchEvent|MouseEvent

the originating Event Object

See:

static gameLocalX :Number

Event X coordinate relative to the holding container

static gameLocalY :Number

Event Y coordinate relative to the holding container

static gameScreenX :Number

Event X coordinate relative to the viewport

static gameScreenY :Number

Event Y coordinate relative to the viewport

static gameWorldX :Number

Event X coordinate relative to the map

static gameWorldY :Number

Event Y coordinate relative to the map

static gameX :Number

Event normalized X coordinate within the game canvas itself

static gameY :Number

Event normalized Y coordinate within the game canvas itself

static isPrimary :Boolean

indicates whether or not the pointer device that created the event is the primary pointer.

See:

static pageX :Number

the horizontal coordinate at which the event occurred, relative to the left edge of the entire document.

See:

static pageY :Number

the vertical coordinate at which the event occurred, relative to the left edge of the entire document.

See:

static pointerId :Number

The unique identifier of the contact for a touch, mouse or pen

See:

static type :String

a string containing the event's type.

See:

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:

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:

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: