Moscrif API Docs for: 2012q3
Show:

Vector Class

include "lib://game2d/particle/vector.ms";
Library: game2d

Vector contains two values x and y, which determines direction in particle systems' classes

Methods

add

(
  • new
)

Add vector coordinates to current vector

Parameters:

copy

()

Create copy of the current vector

Returns:

Vector

fromAngle

(
  • angle
  • magnitude
)

Create new vector basd on an angle and a magnitude

Parameters:

Returns:

Vector

getAngle

()

Return vector angle in radians

Returns:

Float vector angle

getAngleDegrees

()

Return vector angle degree

Returns:

Float

getMagnitude

()

Get Magnitude of the vector

Returns:

Float

init

() protected

Init instance. The init method sets all needed emiter properties acording to developer requirements or to default values (default: [0, 0]).

jitter

(
  • jitterAmount
)

Create new vector based on jitter amount

Parameters:

  • jitterAmount Integer

    jitterAmount

Returns:

Vector

multiply

(
  • scaleFactor
)

Multyply vector coordinates by scaleFactor

Parameters:

vectorTo

(
  • vector
)

Create new vector based on vector passed as parameter

Parameters:

Returns:

Vector

withinBounds

(
  • point
  • size
)

Calculate if point with size is in vector bounds

Parameters:

Returns:

Boolean