Skip to content

GPoint

A utility class to store an x and y coordinate.

Factory Functions

function GPoint(point)
Creates a copy of the given point.
function GPoint([x=0, y=0])
Creates a new GPoint with the given x and y coordinates. If they are both omitted, defaults to 0, 0

Methods

function GPoint::getX()
Returns: The x component of this GPoint.
function GPoint::getY()
Returns: The y component of this GPoint.
function GPoint::setLocation(point)
Sets this GPoint to be equal to the given point.
function GPoint::setLocation(x, y)
Sets this GPoint's location to (x, y).
function GPoint::getLocation()
Returns: A copy of this GPoint.
function GPoint::translate(dx, dy)
Adds dx and dy to the x and y components of this GPoint, respectively.

Fields

GPoint::x
The x component of this GPoint
GPoint::y
The y component of this GPoint