| Package | net.flashpunk.graphics |
| Class | public class ParticleType |
| Inheritance | ParticleType Object |
| Property | Defined By | ||
|---|---|---|---|
| originX : Number = 0
X origin of the frame, determines transformation point. | ParticleType | ||
| originY : Number = 0
Y origin of the frame, determines transformation point. | ParticleType | ||
| Method | Defined By | ||
|---|---|---|---|
ParticleType(name:String, frames:Array, source:BitmapData, frameWidth:uint, frameHeight:uint)
Constructor. | ParticleType | ||
setAlpha(start:Number = 1, finish:Number = 0, ease:Function = null):ParticleType
Sets the alpha range of this particle type. | ParticleType | ||
setColor(start:uint = 0xFFFFFF, finish:uint = 0, ease:Function = null):ParticleType
Sets the color range of this particle type. | ParticleType | ||
setGravity(gravity:Number = 0, gravityRange:Number = 0):ParticleType
Sets the gravity range of this particle type. | ParticleType | ||
setMotion(angle:Number, distance:Number, duration:Number, angleRange:Number = 0, distanceRange:Number = 0, durationRange:Number = 0, ease:Function = null):ParticleType
Defines the motion range for this particle type. | ParticleType | ||
setMotionVector(x:Number, y:Number, duration:Number, durationRange:Number = 0, ease:Function = null):ParticleType
Defines the motion range for this particle type based on the vector. | ParticleType | ||
setRotation(startAngle:Number, spanAngle:Number, startAngleRange:Number = 0, spanAngleRange:Number = 0, smooth:Boolean = false, ease:Function = null):ParticleType
Defines the rotation range for this particle type. | ParticleType | ||
| originX | property |
public var originX:Number = 0X origin of the frame, determines transformation point. Defaults to top-left corner.
| originY | property |
public var originY:Number = 0Y origin of the frame, determines transformation point. Defaults to top-left corner.
| ParticleType | () | Constructor |
public function ParticleType(name:String, frames:Array, source:BitmapData, frameWidth:uint, frameHeight:uint)Constructor.
Parametersname:String — Name of the particle type.
| |
frames:Array — Array of frame indices to animate through.
| |
source:BitmapData — Source image.
| |
frameWidth:uint — Frame width.
| |
frameHeight:uint — Frame height.
|
| setAlpha | () | method |
public function setAlpha(start:Number = 1, finish:Number = 0, ease:Function = null):ParticleTypeSets the alpha range of this particle type.
Parameters
start:Number (default = 1) — The starting alpha.
| |
finish:Number (default = 0) — The finish alpha.
| |
ease:Function (default = null) — Optional easer function.
|
ParticleType — This ParticleType object.
|
| setColor | () | method |
public function setColor(start:uint = 0xFFFFFF, finish:uint = 0, ease:Function = null):ParticleTypeSets the color range of this particle type.
Parameters
start:uint (default = 0xFFFFFF) — The starting color.
| |
finish:uint (default = 0) — The finish color.
| |
ease:Function (default = null) — Optional easer function.
|
ParticleType — This ParticleType object.
|
| setGravity | () | method |
public function setGravity(gravity:Number = 0, gravityRange:Number = 0):ParticleTypeSets the gravity range of this particle type.
Parameters
gravity:Number (default = 0) — Gravity amount to affect to the particle y velocity.
| |
gravityRange:Number (default = 0) — Random amount to add to the particle's gravity.
|
ParticleType — This ParticleType object.
|
| setMotion | () | method |
public function setMotion(angle:Number, distance:Number, duration:Number, angleRange:Number = 0, distanceRange:Number = 0, durationRange:Number = 0, ease:Function = null):ParticleTypeDefines the motion range for this particle type.
Parameters
angle:Number — Launch Direction.
| |
distance:Number — Distance to travel.
| |
duration:Number — Particle duration.
| |
angleRange:Number (default = 0) — Random amount to add to the particle's direction.
| |
distanceRange:Number (default = 0) — Random amount to add to the particle's distance.
| |
durationRange:Number (default = 0) — Random amount to add to the particle's duration.
| |
ease:Function (default = null) — Optional easer function.
|
ParticleType — This ParticleType object.
|
| setMotionVector | () | method |
public function setMotionVector(x:Number, y:Number, duration:Number, durationRange:Number = 0, ease:Function = null):ParticleTypeDefines the motion range for this particle type based on the vector.
Parameters
x:Number — X distance to move.
| |
y:Number — Y distance to move.
| |
duration:Number — Particle duration.
| |
durationRange:Number (default = 0) — Random amount to add to the particle's duration.
| |
ease:Function (default = null) — Optional easer function.
|
ParticleType — This ParticleType object.
|
| setRotation | () | method |
public function setRotation(startAngle:Number, spanAngle:Number, startAngleRange:Number = 0, spanAngleRange:Number = 0, smooth:Boolean = false, ease:Function = null):ParticleTypeDefines the rotation range for this particle type.
Parameters
startAngle:Number — The particle type.
| |
spanAngle:Number — Starting angle.
| |
startAngleRange:Number (default = 0) — Total amount of degrees to rotate.
| |
spanAngleRange:Number (default = 0) — Random amount to add to the particle's starting angle.
| |
smooth:Boolean (default = false) — Random amount to add to the particle's span angle.
| |
ease:Function (default = null) — Whether to smooth the resulting rotated particle.
|
ParticleType — This ParticleType object.
|