C# 클래스 flxSharp.flxSharp.FlxEmitter

FlxEmitter is a lightweight particle emitter. It can be used for one-time explosions or for continuous fx like rain and fire. FlxEmitter is not optimized or anything; all it does is launch FlxParticle objects out at set intervals by setting their positions and velocities accordingly. It is easy to use and relatively efficient, relying on FlxGroup's RECYCLE POWERS.
상속: fliXNA_xbox.FlxGroup
파일 보기 프로젝트 열기: jlorek/flxSharp

공개 프로퍼티들

프로퍼티 타입 설명
bounce float
frequency float
gravity float
lifespan float
maxParticleSpeed FlxPoint
maxRotation float
minParticleSpeed FlxPoint
minRotation float
on bool
particleClass Object
particleDrag FlxPoint

보호된 프로퍼티들

프로퍼티 타입 설명
_counter uint
_explode bool
_point FlxPoint
_quantity uint
_timer float

공개 메소드들

메소드 설명
FlxEmitter ( float X, float Y, uint size ) : System

Creates a new FlxEmitter object at a specific position. Does NOT automatically generate or attach particles!

at ( FlxObject flxObject ) : void

Change the emitter's midpoint to match the midpoint of a FlxObject.

destroy ( ) : void

Clean up memory.

emitParticle ( ) : void

This function can be used both internally and externally to emit the next particle.

kill ( ) : void

Call this function to turn off all the particles and the emitter.

makeParticles ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, uint Quantity = 50, uint BakedRotations, bool Multiple = false, float Collide = 0.8f ) : FlxEmitter

This function generates a new array of particle sprites to attach to the emitter.

setRotation ( float Min, float Max ) : void

A more compact way of setting the angular velocity constraints of the emitter.

setSize ( uint Width, uint Height ) : void

A more compact way of setting the width and height of the emitter.

setXSpeed ( float Min, float Max ) : void

A more compact way of setting the X velocity range of the emitter.

setYSpeed ( float Min, float Max ) : void

A more compact way of setting the Y velocity range of the emitter.

start ( bool Explode = true, float Lifespan, float Frequency = 0.1f, uint Quantity ) : void

Call this function to start emitting particles.

update ( ) : void

Called automatically by the game loop, decides when to launch particles and when to "die".

메소드 상세

FlxEmitter() 공개 메소드

Creates a new FlxEmitter object at a specific position. Does NOT automatically generate or attach particles!
public FlxEmitter ( float X, float Y, uint size ) : System
X float The X position of the emitter.
Y float The Y position of the emitter.
size uint Optional, specifies a maximum capacity for this emitter.
리턴 System

at() 공개 메소드

Change the emitter's midpoint to match the midpoint of a FlxObject.
public at ( FlxObject flxObject ) : void
flxObject FlxObject The FlxObject that you want to sync up with.
리턴 void

destroy() 공개 메소드

Clean up memory.
public destroy ( ) : void
리턴 void

emitParticle() 공개 메소드

This function can be used both internally and externally to emit the next particle.
public emitParticle ( ) : void
리턴 void

kill() 공개 메소드

Call this function to turn off all the particles and the emitter.
public kill ( ) : void
리턴 void

makeParticles() 공개 메소드

This function generates a new array of particle sprites to attach to the emitter.
public makeParticles ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, uint Quantity = 50, uint BakedRotations, bool Multiple = false, float Collide = 0.8f ) : FlxEmitter
graphics Microsoft.Xna.Framework.Graphics.Texture2D Texture for the particles - can be one square or a spritesheet. Set Multiple to true if it is a spritesheet and it will automatically create the particles as long as each frame on the spritesheet is square
Quantity uint The number of particles to generate
BakedRotations uint
Multiple bool Whether or not the Texture contains multiple sprites for particles
Collide float The collidability of the particle, 1 = Full and 0 = None
리턴 FlxEmitter

setRotation() 공개 메소드

A more compact way of setting the angular velocity constraints of the emitter.
public setRotation ( float Min, float Max ) : void
Min float The minimum value for this range.
Max float The maximum value for this range.
리턴 void

setSize() 공개 메소드

A more compact way of setting the width and height of the emitter.
public setSize ( uint Width, uint Height ) : void
Width uint The desired width of the emitter (particles are spawned randomly within these dimensions).
Height uint The desired height of the emitter.
리턴 void

setXSpeed() 공개 메소드

A more compact way of setting the X velocity range of the emitter.
public setXSpeed ( float Min, float Max ) : void
Min float The minimum value for this range.
Max float The maximum value for this range.
리턴 void

setYSpeed() 공개 메소드

A more compact way of setting the Y velocity range of the emitter.
public setYSpeed ( float Min, float Max ) : void
Min float The minimum value for this range.
Max float The maximum value for this range.
리턴 void

start() 공개 메소드

Call this function to start emitting particles.
public start ( bool Explode = true, float Lifespan, float Frequency = 0.1f, uint Quantity ) : void
Explode bool Whether the particles should all burst out at once.
Lifespan float How long each particle lives once emitted. 0 = forever.
Frequency float Ignored if Explode is set to true. Frequency is how often to emit a particle. 0 = never emit, 0.1 = 1 particle every 0.1 seconds, 5 = 1 particle every 5 seconds.
Quantity uint How many particles to launch. 0 = "all of the particles".
리턴 void

update() 공개 메소드

Called automatically by the game loop, decides when to launch particles and when to "die".
public update ( ) : void
리턴 void

프로퍼티 상세

_counter 보호되어 있는 프로퍼티

Internal counter for figuring out how many particles to launch.
protected uint _counter
리턴 uint

_explode 보호되어 있는 프로퍼티

Internal helper for the style of particle emission (all at once, or one at a time).
protected bool _explode
리턴 bool

_point 보호되어 있는 프로퍼티

Internal counter for figuring out how many particles to launch.
protected FlxPoint,flxSharp.flxSharp _point
리턴 FlxPoint

_quantity 보호되어 있는 프로퍼티

Internal helper for deciding how many particles to launch.
protected uint _quantity
리턴 uint

_timer 보호되어 있는 프로퍼티

Internal helper for deciding when to launch particles or kill them.
protected float _timer
리턴 float

bounce 공개적으로 프로퍼티

How much each particle should bounce. 1 = full bounce, 0 = no bounce.
public float bounce
리턴 float

frequency 공개적으로 프로퍼티

How often a particle is emitted (if emitter is started with Explode == false).
public float frequency
리턴 float

gravity 공개적으로 프로퍼티

Sets the acceleration.y member of each particle to this value on launch.
public float gravity
리턴 float

lifespan 공개적으로 프로퍼티

How long each particle lives once it is emitted. Set lifespan to 'zero' for particles to live forever.
public float lifespan
리턴 float

maxParticleSpeed 공개적으로 프로퍼티

The maximum possible velocity of a particle. The default value is (100,100).
public FlxPoint,flxSharp.flxSharp maxParticleSpeed
리턴 FlxPoint

maxRotation 공개적으로 프로퍼티

The maximum possible angular velocity of a particle. The default value is 360. NOTE: rotating particles are more expensive to draw than non-rotating ones!
public float maxRotation
리턴 float

minParticleSpeed 공개적으로 프로퍼티

The X position of the top left corner of the emitter in world space. Already inherited by FlxObject. The Y position of the top left corner of emitter in world space. Already inherited by FlxObject. The width of the emitter. Particles can be randomly generated from anywhere within this box. Already inherited by FlxObject. The height of the emitter. Particles can be randomly generated from anywhere within this box. Already inherited by FlxObject. The minimum possible velocity of a particle. The default value is (-100,-100).
public FlxPoint,flxSharp.flxSharp minParticleSpeed
리턴 FlxPoint

minRotation 공개적으로 프로퍼티

The minimum possible angular velocity of a particle. The default value is -360. NOTE: rotating particles are more expensive to draw than non-rotating ones!
public float minRotation
리턴 float

on 공개적으로 프로퍼티

Determines whether the emitter is currently emitting particles. It is totally safe to directly toggle this.
public bool on
리턴 bool

particleClass 공개적으로 프로퍼티

Set your own particle class type here. Default is FlxParticle.
public Object particleClass
리턴 Object

particleDrag 공개적으로 프로퍼티

The X and Y drag component of particles launched from the emitter.
public FlxPoint,flxSharp.flxSharp particleDrag
리턴 FlxPoint