Class: Cursor

Cursor

new Cursor(type)

todoc
Parameters:
Name Type Description
type String
Source:

Extends

Members

(readonly) onScreen :Boolean

The state of the cursor
Type:
  • Boolean
Default Value:
  • false
Source:

(readonly) type :String

The type of the cursor
Type:
  • String
Default Value:
  • 'mouse'
Source:

x :Number

The x position of the vector
Inherited From:
Type:
  • Number
Default Value:
  • 0
Source:

y :Number

The y position of the vector
Inherited From:
Type:
  • Number
Default Value:
  • 0
Source:

Methods

add(v) → {Vector2}

Modifies the x and y values of the vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

addScalar(s) → {Vector2}

Modifies the x and y values of the vector by the given scalar value
Parameters:
Name Type Description
s Number
Inherited From:
Source:
Returns:
Vector2
this

addVectors(v1, v2) → {Vector2}

Sets the x and y values of the vector to the sum of the two given vectors
Parameters:
Name Type Description
v1 Vector2
v2 Vector2
Inherited From:
Source:
Returns:
Vector2
this

angleTo(v) → {Number}

Returns the angle between this and the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Number

ceil() → {Vector2}

Sets the vector x and y values to the smallest integer greater than or equal to it's value
Inherited From:
Source:
Returns:
Vector2
this

clone() → {Vector2}

Clones the vector
Inherited From:
Source:
Returns:
Vector2

copy(v) → {Vector2}

Copies the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

cross(v) → {Number}

Returns the 2D cross product between this and the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Number

distanceTo(v) → {Number}

Returns the distance between this and the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Number

divide(v) → {Vector2}

Divides the x and y values of the vector by the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

divideScalar(s) → {Vector2}

Divides the x and y values of the vector by the given scalar value
Parameters:
Name Type Description
s Number
Inherited From:
Source:
Returns:
Vector2
this

dot(v) → {Number}

Returns the dot product between this and the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Number

equals(v) → {Boolean}

Determines if the given vector is equal to this vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Boolean

floor() → {Vector2}

Sets the vector x and y values to the largest integer less than or equal to it's value
Inherited From:
Source:
Returns:
Vector2
this

length() → {Number}

Returns the length of the vector
Inherited From:
Source:
Returns:
Number

max(v) → {Vector2}

Sets the vector x and y values to the maximum from it's value and the given vector's value
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

min(v) → {Vector2}

Sets the vector x and y values to the minimum from it's value and the given vector's value
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

multiply(v) → {Vector2}

Multiplies the x and y values of the vector by the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

multiplyScalar(s) → {Vector2}

Multiplies the x and y values of the vector by the given scalar value
Parameters:
Name Type Description
s Number
Inherited From:
Source:
Returns:
Vector2
this

negate() → {Vector2}

Negates the vectors x and y values
Inherited From:
Source:
Returns:
Vector2
this

normalize() → {Vector2}

Normalizes the vector
Inherited From:
Source:
Returns:
Vector2
this

rotate(rad) → {Vector2}

Rotates the vector by a given radian
Parameters:
Name Type Description
rad Number
Inherited From:
Source:
Returns:
Vector2
this

round() → {Vector2}

Sets the vector x and y values to the nearest integer to it's value
Inherited From:
Source:
Returns:
Vector2
this

set(x, y) → {Vector2}

Sets the x and y values of the vector
Parameters:
Name Type Description
x Number
y Number
Inherited From:
Source:
Returns:
Vector2
this

setLength(v) → {Vector2}

Sets the length of the vector to the length of the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

setX(x) → {Vector2}

Sets the x value of the vector
Parameters:
Name Type Description
x Number
Inherited From:
Source:
Returns:
Vector2
this

setY(y) → {Vector2}

Sets the y value of the vector
Parameters:
Name Type Description
y Number
Inherited From:
Source:
Returns:
Vector2
this

sub(v) → {Vector2}

Modifies the x and y values of the vector by the given vector
Parameters:
Name Type Description
v Vector2
Inherited From:
Source:
Returns:
Vector2
this

subScalar(s) → {Vector2}

Modifies the x and y values of the vector by the given scalar value
Parameters:
Name Type Description
s Number
Inherited From:
Source:
Returns:
Vector2
this

subVectors(v1, v2) → {Vector2}

Sets the x and y values of the vector to the subtraction of the two given vectors
Parameters:
Name Type Description
v1 Vector2
v2 Vector2
Inherited From:
Source:
Returns:
Vector2
this

toAngle(rad) → {Vector2}

Rotates the vector to a given angle
Parameters:
Name Type Description
rad Number
Inherited From:
Source:
Returns:
Vector2
this

toString() → {String}

Returns the string value of the cursor
Overrides:
Source:
Returns:
String