Documentation ¶
Index ¶
- type Component
- type EasingFn
- type Effect
- type OffsetFn
- type ParticleFace
- type ParticleSource
- type System
- func (ps *System) Add(basic *ecs.BasicEntity, space *common.SpaceComponent, particle *Component)
- func (ps *System) AddByInterface(i ecs.Identifier)
- func (ps *System) AddEntity(i ecs.Identifier)
- func (ps *System) New(w *ecs.World)
- func (ps *System) Remove(e ecs.BasicEntity)
- func (ps *System) Update(dt float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { // DisableSpawning stops the particle source from emitting new particles DisableSpawning bool // RemoveWhenDead removes the entity from the world, once all particles are dead. RemoveWhenDead bool // Effect descripes the particle effect. Effect *Effect }
Component holds the values for an particle emitting entity
func (*Component) GetParticleComponent ¶
type Effect ¶
type Effect struct { MaxParticles uint ParticleEmitRate float32 MaxLife, MinLife float32 StartSize, EndSize engo.Point SizeEasing EasingFn StartColor, EndColor color.Color ColorEasing EasingFn StartTranslation OffsetFn StartVelocity OffsetFn Acceleration engo.Point MaxRotation, MinRotation float32 MaxRotationVelocity, MinRotationVelocity float32 Drawable common.Drawable Shader common.Shader }
Effect descripes a particle effect and can be reused by multiple particle emitting entities.
type OffsetFn ¶
OffsetFn should return an offset for calculating start velocity or start translation
func OffsetInRect ¶
OffsetInRect returns an OffsetFn which returns a random Point in the given range.
type ParticleFace ¶
type ParticleFace interface {
GetParticleComponent() *Component
}
type ParticleSource ¶
type ParticleSource interface { common.BasicFace common.SpaceFace ParticleFace }
type System ¶
type System struct {
// contains filtered or unexported fields
}
func (*System) Add ¶
func (ps *System) Add(basic *ecs.BasicEntity, space *common.SpaceComponent, particle *Component)
Add adds an entity to the particle system.
func (*System) AddByInterface ¶
func (ps *System) AddByInterface(i ecs.Identifier)
AddByInterface adds any ParticleSource to the particle system.
func (*System) AddEntity ¶
func (ps *System) AddEntity(i ecs.Identifier)
AddEntity adds an entity to the System. This is much like the AddByInterface but it checks if the type matches.
Click to show internal directories.
Click to hide internal directories.