Moscrif API Docs for: 2012q3
Show:

Fields Class

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

Fields class represents force field, which affects velocity of particles. An instance of this class is set to Emitter.process method.

Item Index

Methods

Properties

Methods

init

() protected

Init instance. The init method sets all needed fields properties acording to developer requirements or to default values. This method is called when field object is constructed.

moveTo

(
  • point
)

Move field onto a new positoin.

Parameters:

  • point Vector

    X and y coordinates of new field position

Properties

mass

Integer

The mass of the field. Default is set to 100.

Example:

new Field ({
    position    : new Vector({x:System.width/2, y:System.height/2}),
    mass        : 250
})

position

Vector

Location of the field center in pixels.

Example:

new Field ({
    position    : new Vector({x:System.width/2, y:System.height/2}),
    mass        : 250
})

size

Integer

Defines how large the field size is for dynamics computations. Default is set to 8.