Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
87a50f41
Commit
87a50f41
authored
Aug 11, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds API docs to particle systems and removes redundant property
parent
3eaf50a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
2 deletions
+68
-2
particle_system.dart
examples/game/lib/particle_system.dart
+68
-2
No files found.
examples/game/lib/particle_system.dart
View file @
87a50f41
...
...
@@ -29,54 +29,121 @@ class _ParticleAccelerations {
double
tangentialAccel
=
0.0
;
}
/// A particle system uses a large number of sprites to draw complex effects
/// such as explosions, smoke, rain, or fire. There are a number of properties
/// that can be set to control the look of the particle system. Most of the
/// properties have a base value and a variance, these values are used when
/// creating each individual particle. For instance, by setting the [life] to
/// 1.0 and the [lifeVar] to 0.5, each particle will get a life time in the
/// range of 0.5 to 1.5.
///
/// Particles are created and added to the system at [emissionRate], but the
/// number of particles can never exceed the [maxParticles] limit.
class
ParticleSystem
extends
Node
{
/// The texture used to draw each individual sprite.
Texture
texture
;
/// The time in seconds each particle will be alive.
double
life
;
/// Variance of the [life] property.
double
lifeVar
;
/// The variance of a particles initial position.
Point
posVar
;
/// The start scale of each individual particle.
double
startSize
;
/// Variance of the [startSize] property.
double
startSizeVar
;
/// The end scale of each individual particle.
double
endSize
;
/// Variance of the [endSize] property.
double
endSizeVar
;
/// The start rotation of each individual particle.
double
startRotation
;
/// Variance of the [startRotation] property.
double
startRotationVar
;
/// The end rotation of each individual particle.
double
endRotation
;
/// Variance of the [endRotation] property.
double
endRotationVar
;
/// If true, each particle will be rotated to the direction of the movement
/// of the particle. The calculated rotation will be added to the current
/// rotation as calculated by the [startRotation] and [endRotation]
/// properties.
bool
rotateToMovement
;
/// The direction in which each particle will be emitted in degrees.
double
direction
;
/// Variance of the [direction] property.
double
directionVar
;
/// The speed at which each particle will be emitted.
double
speed
;
/// Variance of the [direction] property.
double
speedVar
;
/// The radial acceleration of each induvidual particle.
double
radialAcceleration
;
/// Variance of the [radialAcceleration] property.
double
radialAccelerationVar
;
/// The tangential acceleration of each individual particle.
double
tangentialAcceleration
;
/// Variance of the [tangentialAcceleration] property.
double
tangentialAccelerationVar
;
/// The gravity vector of the particle system.
Vector2
gravity
;
/// The maximum number of particles the system can display at a single time.
int
maxParticles
;
/// Total number of particles to emit, if the value is set to 0 the system
/// will continue to emit particles for an indifinte period of time.
int
numParticlesToEmit
;
/// The rate at which particles are emitted, defined in particles per second.
double
emissionRate
;
/// If set to true, the particle system will be automatically removed as soon
/// as there are no more particles left to draw.
bool
autoRemoveOnFinish
;
/// The [ColorSequence] used to animate the color of each individual particle
/// over the duration of its [life]. When applied to a particle the sequence's
/// color stops modified in accordance with the [alphaVar], [redVar],
/// [greenVar], and [blueVar] properties.
ColorSequence
colorSequence
;
/// Alpha varience of the [colorSequence] property.
int
alphaVar
;
/// Red varience of the [colorSequence] property.
int
redVar
;
/// Green varience of the [colorSequence] property.
int
greenVar
;
/// Blue varience of the [colorSequence] property.
int
blueVar
;
TransferMode
colorTransferMode
;
/// The transfer mode used to draw the particle system. Default is
/// [TransferMode.plus].
TransferMode
transferMode
;
List
<
_Particle
>
_particles
;
...
...
@@ -117,7 +184,6 @@ class ParticleSystem extends Node {
this
.
redVar
:
0
,
this
.
greenVar
:
0
,
this
.
blueVar
:
0
,
this
.
colorTransferMode
:
TransferMode
.
multiply
,
this
.
transferMode
:
TransferMode
.
plus
,
this
.
numParticlesToEmit
:
0
,
this
.
autoRemoveOnFinish
:
true
})
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment