Glade Reference


Point class

A Point class represents a coordinate or xy pair.

 

p = Point

Creates a Point object p. The Point is initialised to (0, 0) by default.

 

p = Point(int x, int y)

Creates a Point object and initialises its coordinates.

 

int x = p.getX()

int y = p.getY()

Get the specified Point coordinate.

 

p.setX(int x)

p.setY(int y)

Set the specified Point coordinate.

 

operator ==

Returns true if the two Points are equal.

 

operator !=

Returns true if the two Points are not equal.

 

operator <

Returns true if the first point is 'less than' the second. First the X coordinate is compared; if equal then the Y coordinate is compared.

 

operator >

Returns true if the first point is 'greater than' the second. First the X coordinate is compared; if equal then the Y coordinate is compared.

 

operator +

A Point plus a Vector returns a Point transposed by the Vector.

 

operator -

A Point minus a Point returns a Vector.

 

operator -

A Point minus a Vector returns a Point transposed by the Vector.

 

operator +=

A Point plus a scalar (i.e. an integer) is offset, or moved, by the value of the scalar in both X and Y.

A Point plus a Point returns a Point with the sum of the two Points X and Y values.

 

operator -=

A Point minus a Point returns a Point with the differrence of the two Points X and Y values.

 

operator *=

A Point times a scalar is scaled (multiplied) by the scalar.

 

 

Contents|Index

Copyright © Peardrop Design 2016.