TODO

  • Clear suggestion incosistent naming
  • JSDoc
  • converted indent to space
  • documenting methods

About

A simple 2D point

Attributes

NameTypeDescription
xRealThe x component of the point. The x-coordinate of the point in GameMaker is centered at 0, where positive values extend to the right side of the origin.
yRealThe y component of the point. The y-coordinate of the point in GameMaker is based on an origin at 0. Unlike a typical Cartesian plane, positive values extend below the x-axis origin.

Methods

is_inside

Parameters

NameTypeDescription
_p1Point2DPoint2D in the upper left
_p2Point2DPoint2D in the bottom right

Returns

Boolean

Description

This method will return true if self is within the rectangle defined by _p1 and _p2; otherwise, it returns false.

Example

// copy code here

minus

Parameters

NameTypeDescription
_pPoint2DPoint2D used as translation

Returns

None

Description

What

Example

// copy code here

plus

Parameters

NameTypeDescription
_pPoint2DPoint2D used as translation

Returns

None

Description

What

Example

// copy code here

rminus

Parameters

NameTypeDescription
_pPoint2DPoint2D used as translation

Returns

Point2D

Description

Unlike minus, it will create a new Point2D instead of modifying self

Example

// copy code here

rplus

Parameters

NameTypeDescription
_pPoint2DPoint2D used as translation

Returns

Point2D

Description

Unlike plus, it will create a new Point2D instead of modifying self

Example

// copy code here