C# 클래스 XnaFlixel.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 FlxSprite objects out at set intervals by setting their positions and velocities accordingly. It is easy to use and relatively efficient, since it automatically redelays its sprites and/or kills them once they've been launched.
상속: FlxGroup
파일 보기 프로젝트 열기: jsbeckr/XnaFlixel

공개 프로퍼티들

프로퍼티 타입 설명
delay float
justEmitted bool
maxParticleSpeed Vector2
minParticleSpeed Vector2
particleDrag Vector2

공개 메소드들

메소드 설명
At ( FlxObject Object ) : void

Change the emitter's position to the origin of a FlxObject. @param Object The FlxObject that needs to spew particles.

CreateSprites ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, int quantity ) : FlxEmitter

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

CreateSprites ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, int quantity, bool Multiple ) : FlxEmitter

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

CreateSprites ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, int quantity, bool Multiple, float Collide, float Bounce ) : FlxEmitter

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

EmitParticle ( ) : void

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

FlxEmitter ( ) : System.Collections.Generic

Creates a new FlxEmitter object at a specific position. Does not automatically generate or attach particles! @param X The X position of the emitter. @param Y The Y position of the emitter.

FlxEmitter ( int x, int y ) : System.Collections.Generic
Kill ( ) : void

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

SetRotation ( ) : void

A more compact way of setting the angular velocity constraints of the emitter. @param Min The minimum value for this range. @param Max The maximum value for this range.

SetRotation ( float Min, float Max ) : void
SetSize ( int Width, int Height ) : void

A more compact way of setting the width and height of the emitter. @param Width The desired width of the emitter (particles are spawned randomly within these dimensions). @param Height The desired height of the emitter.

SetXSpeed ( ) : void

A more compact way of setting the X velocity range of the emitter. @param Min The minimum value for this range. @param Max The maximum value for this range.

SetXSpeed ( float Min, float Max ) : void
SetYSpeed ( ) : void

A more compact way of setting the Y velocity range of the emitter. @param Min The minimum value for this range. @param Max The maximum value for this range.

SetYSpeed ( float Min, float Max ) : void
Start ( ) : void

Call this function to start emitting particles. @param Explode Whether the particles should all burst out at once. @param Delay You can set the delay (or lifespan) here if you want. @param quantity How many particles to launch. Default value is 0, or "all the particles".

Start ( bool Explode, float Delay ) : void
Start ( bool Explode, float Delay, int Quantity ) : void
Stop ( ) : void

Call this function to stop the emitter without killing it. @param Delay How long to wait before killing all the particles. Set to 'zero' to never kill them.

Stop ( float Delay ) : void
Update ( ) : void

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

보호된 메소드들

메소드 설명
UpdateMembers ( ) : void

Internal function that actually goes through and updates all the group members. Overridden here to remove the position update code normally used by a FlxGroup.

비공개 메소드들

메소드 설명
Initialize ( int x, int y ) : void
UpdateEmitter ( ) : void

Internal function that actually performs the emitter update (called by update()).

메소드 상세

At() 공개 메소드

Change the emitter's position to the origin of a FlxObject. @param Object The FlxObject that needs to spew particles.
public At ( FlxObject Object ) : void
Object FlxObject
리턴 void

CreateSprites() 공개 메소드

This function generates a new array of sprites to attach to the emitter.
public CreateSprites ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, int quantity ) : FlxEmitter
graphics Microsoft.Xna.Framework.Graphics.Texture2D If you opted to not pre-configure an array of FlxSprite objects, you can simply pass in a particle image or sprite sheet.
quantity int The number of particles to generate when using the "create from image" option.
리턴 FlxEmitter

CreateSprites() 공개 메소드

This function generates a new array of sprites to attach to the emitter.
public CreateSprites ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, int quantity, bool Multiple ) : FlxEmitter
graphics Microsoft.Xna.Framework.Graphics.Texture2D If you opted to not pre-configure an array of FlxSprite objects, you can simply pass in a particle image or sprite sheet.
quantity int The number of particles to generate when using the "create from image" option.
Multiple bool Whether the image in the graphics param is a single particle or a bunch of particles (if it's a bunch, they need to be square!).
리턴 FlxEmitter

CreateSprites() 공개 메소드

This function generates a new array of sprites to attach to the emitter.
public CreateSprites ( Microsoft.Xna.Framework.Graphics.Texture2D graphics, int quantity, bool Multiple, float Collide, float Bounce ) : FlxEmitter
graphics Microsoft.Xna.Framework.Graphics.Texture2D If you opted to not pre-configure an array of FlxSprite objects, you can simply pass in a particle image or sprite sheet.
quantity int The number of particles to generate when using the "create from image" option.
Multiple bool Whether the image in the graphics param is a single particle or a bunch of particles (if it's a bunch, they need to be square!).
Collide float Whether the particles should be flagged as not 'dead' (non-colliding particles are higher performance). 0 means no collisions, 0-1 controls scale of particle's bounding box.
Bounce float Whether the particles should bounce after colliding with things. 0 means no bounce, 1 means full reflection.
리턴 FlxEmitter

EmitParticle() 공개 메소드

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

FlxEmitter() 공개 메소드

Creates a new FlxEmitter object at a specific position. Does not automatically generate or attach particles! @param X The X position of the emitter. @param Y The Y position of the emitter.
public FlxEmitter ( ) : System.Collections.Generic
리턴 System.Collections.Generic

FlxEmitter() 공개 메소드

public FlxEmitter ( int x, int y ) : System.Collections.Generic
x int
y int
리턴 System.Collections.Generic

Kill() 공개 메소드

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

SetRotation() 공개 메소드

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

SetRotation() 공개 메소드

public SetRotation ( float Min, float Max ) : void
Min float
Max float
리턴 void

SetSize() 공개 메소드

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

SetXSpeed() 공개 메소드

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

SetXSpeed() 공개 메소드

public SetXSpeed ( float Min, float Max ) : void
Min float
Max float
리턴 void

SetYSpeed() 공개 메소드

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

SetYSpeed() 공개 메소드

public SetYSpeed ( float Min, float Max ) : void
Min float
Max float
리턴 void

Start() 공개 메소드

Call this function to start emitting particles. @param Explode Whether the particles should all burst out at once. @param Delay You can set the delay (or lifespan) here if you want. @param quantity How many particles to launch. Default value is 0, or "all the particles".
public Start ( ) : void
리턴 void

Start() 공개 메소드

public Start ( bool Explode, float Delay ) : void
Explode bool
Delay float
리턴 void

Start() 공개 메소드

public Start ( bool Explode, float Delay, int Quantity ) : void
Explode bool
Delay float
Quantity int
리턴 void

Stop() 공개 메소드

Call this function to stop the emitter without killing it. @param Delay How long to wait before killing all the particles. Set to 'zero' to never kill them.
public Stop ( ) : void
리턴 void

Stop() 공개 메소드

public Stop ( float Delay ) : void
Delay float
리턴 void

Update() 공개 메소드

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

UpdateMembers() 보호된 메소드

Internal function that actually goes through and updates all the group members. Overridden here to remove the position update code normally used by a FlxGroup.
protected UpdateMembers ( ) : void
리턴 void

프로퍼티 상세

delay 공개적으로 프로퍼티

This variable has different effects depending on what kind of emission it is. During an explosion, delay controls the lifespan of the particles. During normal emission, delay controls the time between particle launches. NOTE: In older builds, polarity (negative numbers) was used to define emitter behavior. THIS IS NO LONGER THE CASE! FlxEmitter.start() controls that now!
public float delay
리턴 float

justEmitted 공개적으로 프로퍼티

Checks whether you already fired a particle this frame.
public bool justEmitted
리턴 bool

maxParticleSpeed 공개적으로 프로퍼티

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

minParticleSpeed 공개적으로 프로퍼티

The minimum possible velocity of a particle. The default value is (-100,-100).
public Vector2 minParticleSpeed
리턴 Vector2

particleDrag 공개적으로 프로퍼티

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