Glade Reference


Vector class

A Vector class represents a direction.

 

v= Vector

Creates a Vector object v. The Vector is initialised to (0 0) by default.

v = Vector(x, y)

Creates a Vector v, initialised with the values x and y.

 

setX(int x)

Set the Vector X value.

 

setY(int y)

Set the Vector Y value.

 

x = v.x

Get the X component of the Vector v.

 

y = v.y

Get the Y component of the Vector v.

 

operator +

Adds the two Vectors.

 

operator -

Subtracts the two Vectors.

 

operator *

Returns a Vector multiplied by a scalar.

 

operator /

Returns a Vector divided by a scalar.

 

 

 

Contents|Index

Copyright © Peardrop Design 2020.