Documentation ¶
Index ¶
- Constants
- func RegisterDrawableComponent(w ecs.BaseWorld, f ecs.Flag, fn GetDrawableFn)
- func SetDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity, data DrawLayer)
- func SetParticleEmitterComponentData(w ecs.BaseWorld, e ecs.Entity, data ParticleEmitter)
- func SetSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity, data SpriteAnimation)
- func SetSpriteComponentData(w ecs.BaseWorld, e ecs.Entity, data Sprite)
- func SetTextLabelComponentData(w ecs.BaseWorld, e ecs.Entity, data TextLabel)
- func SetTileSetComponentData(w ecs.BaseWorld, e ecs.Entity, data TileSet)
- type AnimClipMode
- type Animation
- type AnimationClip
- type AnimationEvent
- type AnimationEventFn
- type AnimationEventID
- type AnimationEventListeners
- func (ae *AnimationEventListeners) Add(name string, fn AnimationEventFn) AnimationEventID
- func (ae *AnimationEventListeners) AddCatchAll(fn AnimationEventFn) AnimationEventID
- func (ae *AnimationEventListeners) Clear()
- func (ae *AnimationEventListeners) Dispatch(name, value string)
- func (ae *AnimationEventListeners) Remove(id AnimationEventID) bool
- type DrawLayer
- type DrawLayerComponent
- func (c *DrawLayerComponent) Data(e ecs.Entity) *DrawLayer
- func (c *DrawLayerComponent) Flag() ecs.Flag
- func (DrawLayerComponent) Name() string
- func (c *DrawLayerComponent) Remove(e ecs.Entity)
- func (c *DrawLayerComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (DrawLayerComponent) UUID() string
- func (c *DrawLayerComponent) Upsert(e ecs.Entity, data interface{})
- type DrawLayerDrawableSystem
- func (s *DrawLayerDrawableSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawLayerDrawableSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawLayerDrawableSystem) ComponentResized(cflag ecs.Flag)
- func (s *DrawLayerDrawableSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *DrawLayerDrawableSystem) Disable()
- func (s *DrawLayerDrawableSystem) Draw(ctx core.DrawCtx)
- func (s *DrawLayerDrawableSystem) DrawPriority(ctx core.DrawCtx)
- func (s *DrawLayerDrawableSystem) Enable()
- func (s *DrawLayerDrawableSystem) Enabled() bool
- func (DrawLayerDrawableSystem) Name() string
- func (*DrawLayerDrawableSystem) Priority() int64
- func (s *DrawLayerDrawableSystem) Setup(w ecs.BaseWorld)
- func (DrawLayerDrawableSystem) UUID() string
- func (s *DrawLayerDrawableSystem) Update(ctx core.UpdateCtx)
- func (s *DrawLayerDrawableSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *DrawLayerDrawableSystem) V() *viewDrawLayerDrawableSystem
- type Drawable
- type DrawableTextLabelSystem
- func (s *DrawableTextLabelSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableTextLabelSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableTextLabelSystem) ComponentResized(cflag ecs.Flag)
- func (s *DrawableTextLabelSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *DrawableTextLabelSystem) Disable()
- func (s *DrawableTextLabelSystem) Draw(ctx core.DrawCtx)
- func (s *DrawableTextLabelSystem) DrawPriority(ctx core.DrawCtx)
- func (s *DrawableTextLabelSystem) Enable()
- func (s *DrawableTextLabelSystem) Enabled() bool
- func (DrawableTextLabelSystem) Name() string
- func (*DrawableTextLabelSystem) Priority() int64
- func (s *DrawableTextLabelSystem) Setup(w ecs.BaseWorld)
- func (DrawableTextLabelSystem) UUID() string
- func (s *DrawableTextLabelSystem) Update(ctx core.UpdateCtx)
- func (s *DrawableTextLabelSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *DrawableTextLabelSystem) V() *viewDrawableTextLabelSystem
- type EmissionProp
- type GetDrawableFn
- type LayerIndex
- type LayerTuple
- type Particle
- type ParticleEmitter
- func (e *ParticleEmitter) CompositeMode() ebiten.CompositeMode
- func (e *ParticleEmitter) Draw(ctx core.DrawCtx, tr *components.Transform)
- func (e *ParticleEmitter) DrawMask() core.DrawMask
- func (e *ParticleEmitter) EmissionProp() EmissionProp
- func (e *ParticleEmitter) Emit(tr *components.Transform) bool
- func (e *ParticleEmitter) Enabled() bool
- func (e *ParticleEmitter) MaxParticles() int
- func (e *ParticleEmitter) Props() ParticleProps
- func (e *ParticleEmitter) SetCompositeMode(m ebiten.CompositeMode) *ParticleEmitter
- func (e *ParticleEmitter) SetDrawMask(mask core.DrawMask)
- func (e *ParticleEmitter) SetEmissionProp(prop EmissionProp) *ParticleEmitter
- func (e *ParticleEmitter) SetEnabled(enabled bool) *ParticleEmitter
- func (e *ParticleEmitter) SetLockedParticles(locked bool) *ParticleEmitter
- func (e *ParticleEmitter) SetMaxParticles(max int) *ParticleEmitter
- func (e *ParticleEmitter) SetParentLevel(level uint) *ParticleEmitter
- func (e *ParticleEmitter) SetProps(props ParticleProps) *ParticleEmitter
- func (e *ParticleEmitter) SetStrategy(strategy SpawnStrategy) *ParticleEmitter
- func (e *ParticleEmitter) Update(ctx core.UpdateCtx, tr *components.Transform)
- type ParticleEmitterComponent
- func (c *ParticleEmitterComponent) Data(e ecs.Entity) *ParticleEmitter
- func (c *ParticleEmitterComponent) Flag() ecs.Flag
- func (ParticleEmitterComponent) Name() string
- func (c *ParticleEmitterComponent) Remove(e ecs.Entity)
- func (c *ParticleEmitterComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (ParticleEmitterComponent) UUID() string
- func (c *ParticleEmitterComponent) Upsert(e ecs.Entity, data interface{})
- type ParticleEmitterSystem
- func (s *ParticleEmitterSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *ParticleEmitterSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *ParticleEmitterSystem) ComponentResized(cflag ecs.Flag)
- func (s *ParticleEmitterSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *ParticleEmitterSystem) Disable()
- func (s *ParticleEmitterSystem) Draw(ctx core.DrawCtx)
- func (s *ParticleEmitterSystem) DrawPriority(ctx core.DrawCtx)
- func (s *ParticleEmitterSystem) Enable()
- func (s *ParticleEmitterSystem) Enabled() bool
- func (ParticleEmitterSystem) Name() string
- func (*ParticleEmitterSystem) Priority() int64
- func (s *ParticleEmitterSystem) Setup(w ecs.BaseWorld)
- func (ParticleEmitterSystem) UUID() string
- func (s *ParticleEmitterSystem) Update(ctx core.UpdateCtx)
- func (s *ParticleEmitterSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *ParticleEmitterSystem) V() *viewParticleEmitterSystem
- type ParticleProps
- type PcAnimClip
- func (c PcAnimClip) GetEndedEvent() *AnimationEvent
- func (c PcAnimClip) GetEvents() []*AnimationEvent
- func (c PcAnimClip) GetFPS() float64
- func (c PcAnimClip) GetFrameCount() int
- func (c PcAnimClip) GetImage(frame int) *ebiten.Image
- func (c PcAnimClip) GetMode() AnimClipMode
- func (c PcAnimClip) GetName() string
- func (c PcAnimClip) GetOffset(frame int) (x, y float64)
- func (c PcAnimClip) GetRect(frame int) image.Rectangle
- type PcFrame
- type PrecomputedAnimation
- func (a *PrecomputedAnimation) Count() int
- func (a *PrecomputedAnimation) Each(fn func(i int, clip AnimationClip) bool)
- func (a *PrecomputedAnimation) GetClip(index int) AnimationClip
- func (a *PrecomputedAnimation) GetClipEvents(index int) []*AnimationEvent
- func (a *PrecomputedAnimation) GetClipImage(clipi, frame int) *ebiten.Image
- func (a *PrecomputedAnimation) GetClipOffset(clipi, frame int) (x, y float64)
- func (a *PrecomputedAnimation) GetClipRect(clipi, frame int) image.Rectangle
- type SoloDrawableSystem
- func (s *SoloDrawableSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *SoloDrawableSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *SoloDrawableSystem) ComponentResized(cflag ecs.Flag)
- func (s *SoloDrawableSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *SoloDrawableSystem) Disable()
- func (s *SoloDrawableSystem) Draw(ctx core.DrawCtx)
- func (s *SoloDrawableSystem) DrawPriority(ctx core.DrawCtx)
- func (s *SoloDrawableSystem) Enable()
- func (s *SoloDrawableSystem) Enabled() bool
- func (SoloDrawableSystem) Name() string
- func (*SoloDrawableSystem) Priority() int64
- func (s *SoloDrawableSystem) Setup(w ecs.BaseWorld)
- func (SoloDrawableSystem) UUID() string
- func (s *SoloDrawableSystem) Update(ctx core.UpdateCtx)
- func (s *SoloDrawableSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *SoloDrawableSystem) V() *viewSoloDrawableSystem
- type SpawnStrategy
- type Sprite
- func (s *Sprite) Draw(ctx core.DrawCtx, t *components.Transform)
- func (s *Sprite) DrawMask() core.DrawMask
- func (s *Sprite) Image() *ebiten.Image
- func (s *Sprite) Origin() (ox, oy float64)
- func (s *Sprite) ResetColorMatrix()
- func (s *Sprite) RotateHue(theta float64)
- func (s *Sprite) SetCompositeMode(mode ebiten.CompositeMode)
- func (s *Sprite) SetDrawMask(mask core.DrawMask)
- func (s *Sprite) SetEnabled(enabled bool) *Sprite
- func (s *Sprite) SetImage(img *ebiten.Image) *Sprite
- func (s *Sprite) SetOffset(x, y float64) *Sprite
- func (s *Sprite) SetOrigin(ox, oy float64) *Sprite
- func (s *Sprite) Update(ctx core.UpdateCtx, t *components.Transform)
- type SpriteAnimation
- func (a *SpriteAnimation) AddEventListener(name string, fn AnimationEventFn) AnimationEventID
- func (a *SpriteAnimation) AddEventListenerW(fn AnimationEventFn) AnimationEventID
- func (a *SpriteAnimation) AnimEvent(name, value string)
- func (a *SpriteAnimation) Animation() Animation
- func (a *SpriteAnimation) PlayClip(name string) bool
- func (a *SpriteAnimation) PlayClipFrame(name string, frame int) bool
- func (a *SpriteAnimation) PlayClipIndex(i int) bool
- func (a *SpriteAnimation) PlayClipIndexFrame(i, frame int) bool
- func (a *SpriteAnimation) Playing() bool
- func (a *SpriteAnimation) RemoveEventListener(id AnimationEventID) bool
- func (a *SpriteAnimation) Reversed() bool
- func (a *SpriteAnimation) SetAnimation(anim Animation)
- func (a *SpriteAnimation) SetReversed(reversed bool)
- type SpriteAnimationComponent
- func (c *SpriteAnimationComponent) Data(e ecs.Entity) *SpriteAnimation
- func (c *SpriteAnimationComponent) Flag() ecs.Flag
- func (SpriteAnimationComponent) Name() string
- func (c *SpriteAnimationComponent) Remove(e ecs.Entity)
- func (c *SpriteAnimationComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (SpriteAnimationComponent) UUID() string
- func (c *SpriteAnimationComponent) Upsert(e ecs.Entity, data interface{})
- type SpriteAnimationSystem
- func (s *SpriteAnimationSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *SpriteAnimationSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *SpriteAnimationSystem) ComponentResized(cflag ecs.Flag)
- func (s *SpriteAnimationSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *SpriteAnimationSystem) Disable()
- func (s *SpriteAnimationSystem) Draw(ctx core.DrawCtx)
- func (s *SpriteAnimationSystem) DrawPriority(ctx core.DrawCtx)
- func (s *SpriteAnimationSystem) Enable()
- func (s *SpriteAnimationSystem) Enabled() bool
- func (SpriteAnimationSystem) Name() string
- func (*SpriteAnimationSystem) Priority() int64
- func (s *SpriteAnimationSystem) Setup(w ecs.BaseWorld)
- func (SpriteAnimationSystem) UUID() string
- func (s *SpriteAnimationSystem) Update(ctx core.UpdateCtx)
- func (s *SpriteAnimationSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *SpriteAnimationSystem) V() *viewSpriteAnimationSystem
- type SpriteComponent
- func (c *SpriteComponent) Data(e ecs.Entity) *Sprite
- func (c *SpriteComponent) Flag() ecs.Flag
- func (SpriteComponent) Name() string
- func (c *SpriteComponent) Remove(e ecs.Entity)
- func (c *SpriteComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (SpriteComponent) UUID() string
- func (c *SpriteComponent) Upsert(e ecs.Entity, data interface{})
- type TextLabel
- func (l *TextLabel) ComputedSize() image.Point
- func (l *TextLabel) Draw(ctx core.DrawCtx, tr *components.Transform)
- func (l *TextLabel) DrawMask() core.DrawMask
- func (l *TextLabel) FontFaceHeight() int
- func (l *TextLabel) ResetTextOffset()
- func (l *TextLabel) SetColor(c color.Color) *TextLabel
- func (l *TextLabel) SetDrawMask(mask core.DrawMask)
- func (l *TextLabel) SetFaceOffset(x, y int) *TextLabel
- func (l *TextLabel) SetFaceOffsetModeAuto(auto bool) *TextLabel
- func (l *TextLabel) SetFilter(f ebiten.Filter)
- func (l *TextLabel) SetOrigin(ox, oy float64) *TextLabel
- func (l *TextLabel) SetText(t string) *TextLabel
- func (l *TextLabel) Update(ctx core.UpdateCtx, tr *components.Transform)
- type TextLabelComponent
- func (c *TextLabelComponent) Data(e ecs.Entity) *TextLabel
- func (c *TextLabelComponent) Flag() ecs.Flag
- func (TextLabelComponent) Name() string
- func (c *TextLabelComponent) Remove(e ecs.Entity)
- func (c *TextLabelComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (TextLabelComponent) UUID() string
- func (c *TextLabelComponent) Upsert(e ecs.Entity, data interface{})
- type TileSet
- func (t *TileSet) Draw(ctx core.DrawCtx, tr *components.Transform)
- func (s *TileSet) DrawMask() core.DrawMask
- func (s *TileSet) Origin() (ox, oy float64)
- func (s *TileSet) SetCells(cells []int) *TileSet
- func (s *TileSet) SetColsRows(cols, rows int) *TileSet
- func (s *TileSet) SetDB(db []*ebiten.Image) *TileSet
- func (s *TileSet) SetDrawMask(mask core.DrawMask)
- func (s *TileSet) SetEnabled(enabled bool) *TileSet
- func (s *TileSet) SetOffset(x, y float64) *TileSet
- func (s *TileSet) SetOrigin(ox, oy float64) *TileSet
- func (t *TileSet) Update(ctx core.UpdateCtx, tr *components.Transform)
- type TileSetComponent
- func (c *TileSetComponent) Data(e ecs.Entity) *TileSet
- func (c *TileSetComponent) Flag() ecs.Flag
- func (TileSetComponent) Name() string
- func (c *TileSetComponent) Remove(e ecs.Entity)
- func (c *TileSetComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (TileSetComponent) UUID() string
- func (c *TileSetComponent) Upsert(e ecs.Entity, data interface{})
- type TiledAnimation
- func (a *TiledAnimation) Count() int
- func (a *TiledAnimation) Each(fn func(i int, clip AnimationClip) bool)
- func (a *TiledAnimation) GetClip(index int) AnimationClip
- func (a *TiledAnimation) GetClipEvents(index int) []*AnimationEvent
- func (a *TiledAnimation) GetClipImage(clipi, frame int) *ebiten.Image
- func (a *TiledAnimation) GetClipOffset(clipi, frame int) (x, y float64)
- func (a *TiledAnimation) GetClipRect(clipi, frame int) image.Rectangle
- type TiledAnimationClip
- func (c TiledAnimationClip) GetEndedEvent() *AnimationEvent
- func (c TiledAnimationClip) GetEvents() []*AnimationEvent
- func (c TiledAnimationClip) GetFPS() float64
- func (c TiledAnimationClip) GetFrameCount() int
- func (c TiledAnimationClip) GetImage(frame int) *ebiten.Image
- func (c TiledAnimationClip) GetMode() AnimClipMode
- func (c TiledAnimationClip) GetName() string
- func (c TiledAnimationClip) GetOffset(frame int) (x, y float64)
- func (c TiledAnimationClip) GetRect(frame int) image.Rectangle
- type VIDrawLayerDrawableSystem
- type VIDrawableTextLabelSystem
- type VIParticleEmitterSystem
- type VISoloDrawableSystem
- type VISpriteAnimationSystem
- type WatchDrawLayer
- type WatchParticleEmitter
- type WatchSprite
- type WatchSpriteAnimation
- type WatchTextLabel
- type WatchTileSet
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func RegisterDrawableComponent ¶
func RegisterDrawableComponent(w ecs.BaseWorld, f ecs.Flag, fn GetDrawableFn)
func SetDrawLayerComponentData ¶
func SetDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity, data DrawLayer)
SetDrawLayerComponentData updates/adds a DrawLayer to Entity e
func SetParticleEmitterComponentData ¶
func SetParticleEmitterComponentData(w ecs.BaseWorld, e ecs.Entity, data ParticleEmitter)
SetParticleEmitterComponentData updates/adds a ParticleEmitter to Entity e
func SetSpriteAnimationComponentData ¶
func SetSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity, data SpriteAnimation)
SetSpriteAnimationComponentData updates/adds a SpriteAnimation to Entity e
func SetSpriteComponentData ¶
func SetSpriteComponentData(w ecs.BaseWorld, e ecs.Entity, data Sprite)
SetSpriteComponentData updates/adds a Sprite to Entity e
func SetTextLabelComponentData ¶
func SetTextLabelComponentData(w ecs.BaseWorld, e ecs.Entity, data TextLabel)
SetTextLabelComponentData updates/adds a TextLabel to Entity e
func SetTileSetComponentData ¶
func SetTileSetComponentData(w ecs.BaseWorld, e ecs.Entity, data TileSet)
SetTileSetComponentData updates/adds a TileSet to Entity e
Types ¶
type AnimClipMode ¶
type AnimClipMode byte
AnimClipMode determines how time is treated outside of the keyframed range of an animation clip.
const ( // AnimOnce - When time reaches the end of the animation clip, the clip will automatically // stop playing and time will be reset to beginning of the clip. AnimOnce AnimClipMode = 0 // AnimLoop - When time reaches the end of the animation clip, time will continue at the beginning. AnimLoop AnimClipMode = 1 // AnimPingPong - When time reaches the end of the animation clip, time will ping pong back between beginning // and end. AnimPingPong AnimClipMode = 2 // AnimClampForever - Plays back the animation. When it reaches the end, it will keep playing the last frame // and never stop playing. // // When playing backwards it will reach the first frame and will keep playing that. This is useful for code // that uses the Playing bool to avoid activating said trigger. AnimClampForever AnimClipMode = 3 )
type Animation ¶
type Animation interface { Each(fn func(i int, clip AnimationClip) bool) GetClip(index int) AnimationClip GetClipEvents(index int) []*AnimationEvent GetClipImage(clipindex, frame int) *ebiten.Image GetClipRect(clipindex, frame int) image.Rectangle GetClipOffset(clipindex, frame int) (x, y float64) Count() int }
Animation is a shared container of clips (reusable)
type AnimationClip ¶
type AnimationClip interface { GetName() string GetFPS() float64 GetImage(frame int) *ebiten.Image GetFrameCount() int GetMode() AnimClipMode GetEndedEvent() *AnimationEvent GetEvents() []*AnimationEvent GetRect(frame int) image.Rectangle GetOffset(frame int) (x, y float64) }
AnimationClip is the data os an animation clip (reusable)
type AnimationEvent ¶
AnimationEvent holds a name and value to pass to listeners when the event is triggered
type AnimationEventFn ¶
type AnimationEventFn func(name, value string)
AnimationEventFn is a valid AnimationEvent function
type AnimationEventID ¶
type AnimationEventID int64
AnimationEventID is the id oa an animation listener instance
type AnimationEventListeners ¶
type AnimationEventListeners struct {
// contains filtered or unexported fields
}
AnimationEventListeners groups AnimationEvent listeners
func (*AnimationEventListeners) Add ¶
func (ae *AnimationEventListeners) Add(name string, fn AnimationEventFn) AnimationEventID
Add a new listener
func (*AnimationEventListeners) AddCatchAll ¶
func (ae *AnimationEventListeners) AddCatchAll(fn AnimationEventFn) AnimationEventID
AddCatchAll adds a wildcard listener
func (*AnimationEventListeners) Clear ¶
func (ae *AnimationEventListeners) Clear()
Clear removes all event listeners
func (*AnimationEventListeners) Dispatch ¶
func (ae *AnimationEventListeners) Dispatch(name, value string)
Dispatch triggers all compatible listeners with the event
func (*AnimationEventListeners) Remove ¶
func (ae *AnimationEventListeners) Remove(id AnimationEventID) bool
Remove a listener by ID
type DrawLayer ¶
type DrawLayer struct { Layer LayerIndex ZIndex int64 // contains filtered or unexported fields }
func GetDrawLayerComponentData ¶
func GetDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity) *DrawLayer
GetDrawLayerComponentData gets the *DrawLayer of Entity e
type DrawLayerComponent ¶
type DrawLayerComponent struct {
// contains filtered or unexported fields
}
DrawLayerComponent implements ecs.BaseComponent
func GetDrawLayerComponent ¶
func GetDrawLayerComponent(w ecs.BaseWorld) *DrawLayerComponent
GetDrawLayerComponent returns the instance of the component in a World
func (*DrawLayerComponent) Data ¶
func (c *DrawLayerComponent) Data(e ecs.Entity) *DrawLayer
func (DrawLayerComponent) Name ¶
func (DrawLayerComponent) Name() string
Name implements ecs.BaseComponent
func (*DrawLayerComponent) Remove ¶
func (c *DrawLayerComponent) Remove(e ecs.Entity)
Remove a DrawLayer data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*DrawLayerComponent) Setup ¶
func (c *DrawLayerComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (DrawLayerComponent) UUID ¶
func (DrawLayerComponent) UUID() string
UUID implements ecs.BaseComponent
func (*DrawLayerComponent) Upsert ¶
func (c *DrawLayerComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetDrawLayerComponentData to change component data outside of a system loop.
type DrawLayerDrawableSystem ¶
type DrawLayerDrawableSystem struct {
// contains filtered or unexported fields
}
DrawLayerDrawableSystem implements ecs.BaseSystem
func GetDrawLayerDrawableSystem ¶
func GetDrawLayerDrawableSystem(w ecs.BaseWorld) *DrawLayerDrawableSystem
GetDrawLayerDrawableSystem returns the instance of the system in a World
func (*DrawLayerDrawableSystem) ComponentAdded ¶
func (s *DrawLayerDrawableSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawLayerDrawableSystem) ComponentRemoved ¶
func (s *DrawLayerDrawableSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawLayerDrawableSystem) ComponentResized ¶
func (s *DrawLayerDrawableSystem) ComponentResized(cflag ecs.Flag)
func (*DrawLayerDrawableSystem) ComponentWillResize ¶
func (s *DrawLayerDrawableSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawLayerDrawableSystem) Disable ¶
func (s *DrawLayerDrawableSystem) Disable()
Disable system
func (*DrawLayerDrawableSystem) Draw ¶
func (s *DrawLayerDrawableSystem) Draw(ctx core.DrawCtx)
Draw draws a drawable by its layer and zindex order
func (*DrawLayerDrawableSystem) DrawPriority ¶
func (s *DrawLayerDrawableSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority is noop as of now
func (*DrawLayerDrawableSystem) Enabled ¶
func (s *DrawLayerDrawableSystem) Enabled() bool
Enabled checks if enabled
func (DrawLayerDrawableSystem) Name ¶
func (DrawLayerDrawableSystem) Name() string
func (*DrawLayerDrawableSystem) Priority ¶
func (*DrawLayerDrawableSystem) Priority() int64
func (*DrawLayerDrawableSystem) Setup ¶
func (s *DrawLayerDrawableSystem) Setup(w ecs.BaseWorld)
func (DrawLayerDrawableSystem) UUID ¶
func (DrawLayerDrawableSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawLayerDrawableSystem) Update ¶
func (s *DrawLayerDrawableSystem) Update(ctx core.UpdateCtx)
Update is noop as of now
func (*DrawLayerDrawableSystem) UpdatePriority ¶
func (s *DrawLayerDrawableSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority updates layer changes
func (*DrawLayerDrawableSystem) V ¶
func (s *DrawLayerDrawableSystem) V() *viewDrawLayerDrawableSystem
type Drawable ¶
type Drawable interface { DrawMask() core.DrawMask SetDrawMask(mask core.DrawMask) Draw(ctx core.DrawCtx, t *components.Transform) Update(ctx core.UpdateCtx, t *components.Transform) }
Drawable is the component that controls drawing to the ebiten screen
func GetDrawable ¶
func GetDrawable(w ecs.BaseWorld, e ecs.Entity) Drawable
type DrawableTextLabelSystem ¶
type DrawableTextLabelSystem struct {
// contains filtered or unexported fields
}
DrawableTextLabelSystem implements ecs.BaseSystem
func GetDrawableTextLabelSystem ¶
func GetDrawableTextLabelSystem(w ecs.BaseWorld) *DrawableTextLabelSystem
GetDrawableTextLabelSystem returns the instance of the system in a World
func (*DrawableTextLabelSystem) ComponentAdded ¶
func (s *DrawableTextLabelSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawableTextLabelSystem) ComponentRemoved ¶
func (s *DrawableTextLabelSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawableTextLabelSystem) ComponentResized ¶
func (s *DrawableTextLabelSystem) ComponentResized(cflag ecs.Flag)
func (*DrawableTextLabelSystem) ComponentWillResize ¶
func (s *DrawableTextLabelSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawableTextLabelSystem) Disable ¶
func (s *DrawableTextLabelSystem) Disable()
Disable system
func (*DrawableTextLabelSystem) Draw ¶
func (s *DrawableTextLabelSystem) Draw(ctx core.DrawCtx)
Draw noop (drawing is controlled by *Drawable)
func (*DrawableTextLabelSystem) DrawPriority ¶
func (s *DrawableTextLabelSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority noop
func (*DrawableTextLabelSystem) Enabled ¶
func (s *DrawableTextLabelSystem) Enabled() bool
Enabled checks if enabled
func (DrawableTextLabelSystem) Name ¶
func (DrawableTextLabelSystem) Name() string
func (*DrawableTextLabelSystem) Priority ¶
func (*DrawableTextLabelSystem) Priority() int64
func (*DrawableTextLabelSystem) Setup ¶
func (s *DrawableTextLabelSystem) Setup(w ecs.BaseWorld)
func (DrawableTextLabelSystem) UUID ¶
func (DrawableTextLabelSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawableTextLabelSystem) Update ¶
func (s *DrawableTextLabelSystem) Update(ctx core.UpdateCtx)
Update computes labes if dirty
func (*DrawableTextLabelSystem) UpdatePriority ¶
func (s *DrawableTextLabelSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority noop
func (*DrawableTextLabelSystem) V ¶
func (s *DrawableTextLabelSystem) V() *viewDrawableTextLabelSystem
type EmissionProp ¶
type GetDrawableFn ¶
type GetDrawableFn func(w ecs.BaseWorld, e ecs.Entity) Drawable
type LayerTuple ¶
type LayerTuple struct { Index LayerIndex Items *core.EntitySortedList }
LayerTuple is returned when fetching all layers
type ParticleEmitter ¶
type ParticleEmitter struct {
// contains filtered or unexported fields
}
func GetParticleEmitterComponentData ¶
func GetParticleEmitterComponentData(w ecs.BaseWorld, e ecs.Entity) *ParticleEmitter
GetParticleEmitterComponentData gets the *ParticleEmitter of Entity e
func NewParticleEmitter ¶
func NewParticleEmitter(w ecs.BaseWorld) ParticleEmitter
func (*ParticleEmitter) CompositeMode ¶
func (e *ParticleEmitter) CompositeMode() ebiten.CompositeMode
func (*ParticleEmitter) Draw ¶
func (e *ParticleEmitter) Draw(ctx core.DrawCtx, tr *components.Transform)
func (*ParticleEmitter) DrawMask ¶
func (e *ParticleEmitter) DrawMask() core.DrawMask
func (*ParticleEmitter) EmissionProp ¶
func (e *ParticleEmitter) EmissionProp() EmissionProp
func (*ParticleEmitter) Emit ¶
func (e *ParticleEmitter) Emit(tr *components.Transform) bool
func (*ParticleEmitter) Enabled ¶
func (e *ParticleEmitter) Enabled() bool
func (*ParticleEmitter) MaxParticles ¶
func (e *ParticleEmitter) MaxParticles() int
func (*ParticleEmitter) Props ¶
func (e *ParticleEmitter) Props() ParticleProps
func (*ParticleEmitter) SetCompositeMode ¶
func (e *ParticleEmitter) SetCompositeMode(m ebiten.CompositeMode) *ParticleEmitter
func (*ParticleEmitter) SetDrawMask ¶
func (e *ParticleEmitter) SetDrawMask(mask core.DrawMask)
func (*ParticleEmitter) SetEmissionProp ¶
func (e *ParticleEmitter) SetEmissionProp(prop EmissionProp) *ParticleEmitter
func (*ParticleEmitter) SetEnabled ¶
func (e *ParticleEmitter) SetEnabled(enabled bool) *ParticleEmitter
func (*ParticleEmitter) SetLockedParticles ¶
func (e *ParticleEmitter) SetLockedParticles(locked bool) *ParticleEmitter
func (*ParticleEmitter) SetMaxParticles ¶
func (e *ParticleEmitter) SetMaxParticles(max int) *ParticleEmitter
func (*ParticleEmitter) SetParentLevel ¶
func (e *ParticleEmitter) SetParentLevel(level uint) *ParticleEmitter
func (*ParticleEmitter) SetProps ¶
func (e *ParticleEmitter) SetProps(props ParticleProps) *ParticleEmitter
func (*ParticleEmitter) SetStrategy ¶
func (e *ParticleEmitter) SetStrategy(strategy SpawnStrategy) *ParticleEmitter
func (*ParticleEmitter) Update ¶
func (e *ParticleEmitter) Update(ctx core.UpdateCtx, tr *components.Transform)
type ParticleEmitterComponent ¶
type ParticleEmitterComponent struct {
// contains filtered or unexported fields
}
ParticleEmitterComponent implements ecs.BaseComponent
func GetParticleEmitterComponent ¶
func GetParticleEmitterComponent(w ecs.BaseWorld) *ParticleEmitterComponent
GetParticleEmitterComponent returns the instance of the component in a World
func (*ParticleEmitterComponent) Data ¶
func (c *ParticleEmitterComponent) Data(e ecs.Entity) *ParticleEmitter
func (*ParticleEmitterComponent) Flag ¶
func (c *ParticleEmitterComponent) Flag() ecs.Flag
Flag returns the
func (ParticleEmitterComponent) Name ¶
func (ParticleEmitterComponent) Name() string
Name implements ecs.BaseComponent
func (*ParticleEmitterComponent) Remove ¶
func (c *ParticleEmitterComponent) Remove(e ecs.Entity)
Remove a ParticleEmitter data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*ParticleEmitterComponent) Setup ¶
func (c *ParticleEmitterComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (ParticleEmitterComponent) UUID ¶
func (ParticleEmitterComponent) UUID() string
UUID implements ecs.BaseComponent
func (*ParticleEmitterComponent) Upsert ¶
func (c *ParticleEmitterComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetParticleEmitterComponentData to change component data outside of a system loop.
type ParticleEmitterSystem ¶
type ParticleEmitterSystem struct {
// contains filtered or unexported fields
}
ParticleEmitterSystem implements ecs.BaseSystem
func GetParticleEmitterSystem ¶
func GetParticleEmitterSystem(w ecs.BaseWorld) *ParticleEmitterSystem
GetParticleEmitterSystem returns the instance of the system in a World
func (*ParticleEmitterSystem) ComponentAdded ¶
func (s *ParticleEmitterSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*ParticleEmitterSystem) ComponentRemoved ¶
func (s *ParticleEmitterSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*ParticleEmitterSystem) ComponentResized ¶
func (s *ParticleEmitterSystem) ComponentResized(cflag ecs.Flag)
func (*ParticleEmitterSystem) ComponentWillResize ¶
func (s *ParticleEmitterSystem) ComponentWillResize(cflag ecs.Flag)
func (*ParticleEmitterSystem) Draw ¶
func (s *ParticleEmitterSystem) Draw(ctx core.DrawCtx)
Draw noop (drawing is controlled by *Drawable)
func (*ParticleEmitterSystem) DrawPriority ¶
func (s *ParticleEmitterSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority noop
func (*ParticleEmitterSystem) Enabled ¶
func (s *ParticleEmitterSystem) Enabled() bool
Enabled checks if enabled
func (ParticleEmitterSystem) Name ¶
func (ParticleEmitterSystem) Name() string
func (*ParticleEmitterSystem) Priority ¶
func (*ParticleEmitterSystem) Priority() int64
func (*ParticleEmitterSystem) Setup ¶
func (s *ParticleEmitterSystem) Setup(w ecs.BaseWorld)
func (ParticleEmitterSystem) UUID ¶
func (ParticleEmitterSystem) UUID() string
UUID implements ecs.BaseSystem
func (*ParticleEmitterSystem) Update ¶
func (s *ParticleEmitterSystem) Update(ctx core.UpdateCtx)
Update computes labes if dirty
func (*ParticleEmitterSystem) UpdatePriority ¶
func (s *ParticleEmitterSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority noop
func (*ParticleEmitterSystem) V ¶
func (s *ParticleEmitterSystem) V() *viewParticleEmitterSystem
type ParticleProps ¶
type ParticleProps struct {
X, Y float64 // initial position
XVar0, XVar1 float64 // randomized position range
YVar0, YVar1 float64 // randomized position range
XVelocity, YVelocity float64 // initial velocity
XVelocityVar0, XVelocityVar1 float64 // randomized velocity range
YVelocityVar0, YVelocityVar1 float64 // randomized velocity range
XAccel, YAccel float64 // initial acceleration
XAccelVar0, XAccelVar1 float64 // randomized acceleration range
YAccelVar0, YAccelVar1 float64 // randomized acceleration range
Rotation float64 // initial rotation (radians)
RotationVar0, RotationVar1 float64 // randomized initial rotation (radians)
RotationVelocityVar0, RotationVelocityVar1 float64 // randomized initial rotation velocity (radians/second)
RotationAccelVar0, RotationAccelVar1 float64 // initial rotation acceleration (radians/second)
EndRotationAccelVar0, EndRotationAccelVar1 float64 // end rotation acceleration (radians/second)
InitScale float64 // initial scale
InitScaleVar0, InitScaleVar1 float64 // randomized initial scale
EndScale float64 // end scale
EndScaleVar0, EndScaleVar1 float64 // randomized end scale
OriginX, OriginY float64 // origin
Duration float64 // duration
DurationVar0, DurationVar1 float64 // randomized duration (seconds)
HueRotationSpeed float64 // hue shift (/second)
InitColor color.RGBA // initial color tint modifier
EndColor color.RGBA // end color tint modifier
Source []*ebiten.Image // particle source(s); if it's more than one, it will be randomized
}
func (ParticleProps) NewParticle ¶
func (pp ParticleProps) NewParticle(rng *rand.Rand) Particle
func (*ParticleProps) SetPositionRange ¶
func (pp *ParticleProps) SetPositionRange(xmin, xmax, ymin, ymax float64)
func (*ParticleProps) SetVelocityRange ¶
func (pp *ParticleProps) SetVelocityRange(xmin, xmax, ymin, ymax float64)
type PcAnimClip ¶
type PcAnimClip struct { // The name of an animation is not allowed to be changed during runtime // but since this is part of a component (and components shouldn't have logic), // it is a public member. Name string Frames []PcFrame Events []*AnimationEvent //TODO: link Fps float64 ClipMode AnimClipMode EndedEvent *AnimationEvent //TODO: link }
PcAnimClip is a pre-computed animation clip.
func (PcAnimClip) GetEndedEvent ¶
func (c PcAnimClip) GetEndedEvent() *AnimationEvent
func (PcAnimClip) GetEvents ¶
func (c PcAnimClip) GetEvents() []*AnimationEvent
func (PcAnimClip) GetFPS ¶
func (c PcAnimClip) GetFPS() float64
func (PcAnimClip) GetFrameCount ¶
func (c PcAnimClip) GetFrameCount() int
func (PcAnimClip) GetMode ¶
func (c PcAnimClip) GetMode() AnimClipMode
func (PcAnimClip) GetName ¶
func (c PcAnimClip) GetName() string
GetName returns the animation clip name
func (PcAnimClip) GetOffset ¶
func (c PcAnimClip) GetOffset(frame int) (x, y float64)
GetOffset returns the pixel offset (from the origin) of the current frame
type PrecomputedAnimation ¶
type PrecomputedAnimation struct {
Clips []PcAnimClip
}
PrecomputedAnimation is an animation of a one or more image sources It is the default data structure of an Atlas
func (*PrecomputedAnimation) Count ¶
func (a *PrecomputedAnimation) Count() int
Count returns the total count of cnimation clips
func (*PrecomputedAnimation) Each ¶
func (a *PrecomputedAnimation) Each(fn func(i int, clip AnimationClip) bool)
Each iterates through all animation clips
func (*PrecomputedAnimation) GetClip ¶
func (a *PrecomputedAnimation) GetClip(index int) AnimationClip
GetClip returns an animation clip by index
func (*PrecomputedAnimation) GetClipEvents ¶
func (a *PrecomputedAnimation) GetClipEvents(index int) []*AnimationEvent
GetClipEvents returns all animation clip events by the clip index
func (*PrecomputedAnimation) GetClipImage ¶
func (a *PrecomputedAnimation) GetClipImage(clipi, frame int) *ebiten.Image
GetClipImage returns the clip image
func (*PrecomputedAnimation) GetClipOffset ¶
func (a *PrecomputedAnimation) GetClipOffset(clipi, frame int) (x, y float64)
GetClipOffset returns the clip offset
func (*PrecomputedAnimation) GetClipRect ¶
func (a *PrecomputedAnimation) GetClipRect(clipi, frame int) image.Rectangle
GetClipRect returns the clip Rectangle (bounds)
type SoloDrawableSystem ¶
type SoloDrawableSystem struct {
// contains filtered or unexported fields
}
SoloDrawableSystem implements ecs.BaseSystem
func GetSoloDrawableSystem ¶
func GetSoloDrawableSystem(w ecs.BaseWorld) *SoloDrawableSystem
GetSoloDrawableSystem returns the instance of the system in a World
func (*SoloDrawableSystem) ComponentAdded ¶
func (s *SoloDrawableSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*SoloDrawableSystem) ComponentRemoved ¶
func (s *SoloDrawableSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*SoloDrawableSystem) ComponentResized ¶
func (s *SoloDrawableSystem) ComponentResized(cflag ecs.Flag)
func (*SoloDrawableSystem) ComponentWillResize ¶
func (s *SoloDrawableSystem) ComponentWillResize(cflag ecs.Flag)
func (*SoloDrawableSystem) Draw ¶
func (s *SoloDrawableSystem) Draw(ctx core.DrawCtx)
Draw all solo drawables ordered by entity ID
func (*SoloDrawableSystem) DrawPriority ¶
func (s *SoloDrawableSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority is noop as of now
func (*SoloDrawableSystem) Enabled ¶
func (s *SoloDrawableSystem) Enabled() bool
Enabled checks if enabled
func (SoloDrawableSystem) Name ¶
func (SoloDrawableSystem) Name() string
func (*SoloDrawableSystem) Priority ¶
func (*SoloDrawableSystem) Priority() int64
func (*SoloDrawableSystem) Setup ¶
func (s *SoloDrawableSystem) Setup(w ecs.BaseWorld)
func (SoloDrawableSystem) UUID ¶
func (SoloDrawableSystem) UUID() string
UUID implements ecs.BaseSystem
func (*SoloDrawableSystem) Update ¶
func (s *SoloDrawableSystem) Update(ctx core.UpdateCtx)
Update calls drawable.Update()
func (*SoloDrawableSystem) UpdatePriority ¶
func (s *SoloDrawableSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority noop
func (*SoloDrawableSystem) V ¶
func (s *SoloDrawableSystem) V() *viewSoloDrawableSystem
type SpawnStrategy ¶
type SpawnStrategy int
const ( SpawnReplace SpawnStrategy = iota SpawnPause SpawnStrategy = iota )
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite is the data of a sprite component.
func GetSpriteComponentData ¶
func GetSpriteComponentData(w ecs.BaseWorld, e ecs.Entity) *Sprite
GetSpriteComponentData gets the *Sprite of Entity e
func (*Sprite) ResetColorMatrix ¶
func (s *Sprite) ResetColorMatrix()
func (*Sprite) SetCompositeMode ¶
func (s *Sprite) SetCompositeMode(mode ebiten.CompositeMode)
func (*Sprite) SetDrawMask ¶
func (*Sprite) SetEnabled ¶
type SpriteAnimation ¶
type SpriteAnimation struct {
// contains filtered or unexported fields
}
SpriteAnimation holds the data of a sprite animation (and clips)
func GetSpriteAnimationComponentData ¶
func GetSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity) *SpriteAnimation
GetSpriteAnimationComponentData gets the *SpriteAnimation of Entity e
func NewSpriteAnimation ¶
func NewSpriteAnimation(fps float64, anim Animation) SpriteAnimation
func (*SpriteAnimation) AddEventListener ¶
func (a *SpriteAnimation) AddEventListener(name string, fn AnimationEventFn) AnimationEventID
func (*SpriteAnimation) AddEventListenerW ¶
func (a *SpriteAnimation) AddEventListenerW(fn AnimationEventFn) AnimationEventID
func (*SpriteAnimation) AnimEvent ¶
func (a *SpriteAnimation) AnimEvent(name, value string)
AnimEvent dispatches an animation event to listeners
func (*SpriteAnimation) Animation ¶
func (a *SpriteAnimation) Animation() Animation
func (*SpriteAnimation) PlayClip ¶
func (a *SpriteAnimation) PlayClip(name string) bool
PlayClip sets the animation to play a clip by name
func (*SpriteAnimation) PlayClipFrame ¶
func (a *SpriteAnimation) PlayClipFrame(name string, frame int) bool
PlayClip sets the animation to play a clip by name and at a specific frame
func (*SpriteAnimation) PlayClipIndex ¶
func (a *SpriteAnimation) PlayClipIndex(i int) bool
PlayClipIndex plays a clip at index i
func (*SpriteAnimation) PlayClipIndexFrame ¶
func (a *SpriteAnimation) PlayClipIndexFrame(i, frame int) bool
PlayClipIndexFrame plays a clip at index i
func (*SpriteAnimation) Playing ¶
func (a *SpriteAnimation) Playing() bool
func (*SpriteAnimation) RemoveEventListener ¶
func (a *SpriteAnimation) RemoveEventListener(id AnimationEventID) bool
func (*SpriteAnimation) Reversed ¶
func (a *SpriteAnimation) Reversed() bool
func (*SpriteAnimation) SetAnimation ¶
func (a *SpriteAnimation) SetAnimation(anim Animation)
SetAnimation parses the clip map and animations
func (*SpriteAnimation) SetReversed ¶
func (a *SpriteAnimation) SetReversed(reversed bool)
SetReversed sets "reversed". It does nothing if it's not playing.
type SpriteAnimationComponent ¶
type SpriteAnimationComponent struct {
// contains filtered or unexported fields
}
SpriteAnimationComponent implements ecs.BaseComponent
func GetSpriteAnimationComponent ¶
func GetSpriteAnimationComponent(w ecs.BaseWorld) *SpriteAnimationComponent
GetSpriteAnimationComponent returns the instance of the component in a World
func (*SpriteAnimationComponent) Data ¶
func (c *SpriteAnimationComponent) Data(e ecs.Entity) *SpriteAnimation
func (*SpriteAnimationComponent) Flag ¶
func (c *SpriteAnimationComponent) Flag() ecs.Flag
Flag returns the
func (SpriteAnimationComponent) Name ¶
func (SpriteAnimationComponent) Name() string
Name implements ecs.BaseComponent
func (*SpriteAnimationComponent) Remove ¶
func (c *SpriteAnimationComponent) Remove(e ecs.Entity)
Remove a SpriteAnimation data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*SpriteAnimationComponent) Setup ¶
func (c *SpriteAnimationComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (SpriteAnimationComponent) UUID ¶
func (SpriteAnimationComponent) UUID() string
UUID implements ecs.BaseComponent
func (*SpriteAnimationComponent) Upsert ¶
func (c *SpriteAnimationComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetSpriteAnimationComponentData to change component data outside of a system loop.
type SpriteAnimationSystem ¶
type SpriteAnimationSystem struct {
// contains filtered or unexported fields
}
SpriteAnimationSystem implements ecs.BaseSystem
func GetSpriteAnimationSystem ¶
func GetSpriteAnimationSystem(w ecs.BaseWorld) *SpriteAnimationSystem
GetSpriteAnimationSystem returns the instance of the system in a World
func (*SpriteAnimationSystem) ComponentAdded ¶
func (s *SpriteAnimationSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*SpriteAnimationSystem) ComponentRemoved ¶
func (s *SpriteAnimationSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*SpriteAnimationSystem) ComponentResized ¶
func (s *SpriteAnimationSystem) ComponentResized(cflag ecs.Flag)
func (*SpriteAnimationSystem) ComponentWillResize ¶
func (s *SpriteAnimationSystem) ComponentWillResize(cflag ecs.Flag)
func (*SpriteAnimationSystem) Draw ¶
func (s *SpriteAnimationSystem) Draw(ctx core.DrawCtx)
Draw noop
func (*SpriteAnimationSystem) DrawPriority ¶
func (s *SpriteAnimationSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority noop
func (*SpriteAnimationSystem) Enabled ¶
func (s *SpriteAnimationSystem) Enabled() bool
Enabled checks if enabled
func (SpriteAnimationSystem) Name ¶
func (SpriteAnimationSystem) Name() string
func (*SpriteAnimationSystem) Priority ¶
func (*SpriteAnimationSystem) Priority() int64
func (*SpriteAnimationSystem) Setup ¶
func (s *SpriteAnimationSystem) Setup(w ecs.BaseWorld)
func (SpriteAnimationSystem) UUID ¶
func (SpriteAnimationSystem) UUID() string
UUID implements ecs.BaseSystem
func (*SpriteAnimationSystem) Update ¶
func (s *SpriteAnimationSystem) Update(ctx core.UpdateCtx)
Update plays the animations
func (*SpriteAnimationSystem) UpdatePriority ¶
func (s *SpriteAnimationSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority noop
func (*SpriteAnimationSystem) V ¶
func (s *SpriteAnimationSystem) V() *viewSpriteAnimationSystem
type SpriteComponent ¶
type SpriteComponent struct {
// contains filtered or unexported fields
}
SpriteComponent implements ecs.BaseComponent
func GetSpriteComponent ¶
func GetSpriteComponent(w ecs.BaseWorld) *SpriteComponent
GetSpriteComponent returns the instance of the component in a World
func (*SpriteComponent) Data ¶
func (c *SpriteComponent) Data(e ecs.Entity) *Sprite
func (SpriteComponent) Name ¶
func (SpriteComponent) Name() string
Name implements ecs.BaseComponent
func (*SpriteComponent) Remove ¶
func (c *SpriteComponent) Remove(e ecs.Entity)
Remove a Sprite data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*SpriteComponent) Setup ¶
func (c *SpriteComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (SpriteComponent) UUID ¶
func (SpriteComponent) UUID() string
UUID implements ecs.BaseComponent
func (*SpriteComponent) Upsert ¶
func (c *SpriteComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetSpriteComponentData to change component data outside of a system loop.
type TextLabel ¶
type TextLabel struct {
// contains filtered or unexported fields
}
func GetTextLabelComponentData ¶
func GetTextLabelComponentData(w ecs.BaseWorld, e ecs.Entity) *TextLabel
GetTextLabelComponentData gets the *TextLabel of Entity e
func NewTextLabel ¶
func NewTextLabel() TextLabel
func (*TextLabel) ComputedSize ¶
ComputedSize returns the width and height of the printable area of the label
func (*TextLabel) FontFaceHeight ¶
FontFaceHeight returns the font height
func (*TextLabel) ResetTextOffset ¶
func (l *TextLabel) ResetTextOffset()
ResetTextOffset sets the text offset to default (0, l.FontFaceHeight())
func (*TextLabel) SetDrawMask ¶
func (*TextLabel) SetFaceOffset ¶
func (*TextLabel) SetFaceOffsetModeAuto ¶
type TextLabelComponent ¶
type TextLabelComponent struct {
// contains filtered or unexported fields
}
TextLabelComponent implements ecs.BaseComponent
func GetTextLabelComponent ¶
func GetTextLabelComponent(w ecs.BaseWorld) *TextLabelComponent
GetTextLabelComponent returns the instance of the component in a World
func (*TextLabelComponent) Data ¶
func (c *TextLabelComponent) Data(e ecs.Entity) *TextLabel
func (TextLabelComponent) Name ¶
func (TextLabelComponent) Name() string
Name implements ecs.BaseComponent
func (*TextLabelComponent) Remove ¶
func (c *TextLabelComponent) Remove(e ecs.Entity)
Remove a TextLabel data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*TextLabelComponent) Setup ¶
func (c *TextLabelComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (TextLabelComponent) UUID ¶
func (TextLabelComponent) UUID() string
UUID implements ecs.BaseComponent
func (*TextLabelComponent) Upsert ¶
func (c *TextLabelComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetTextLabelComponentData to change component data outside of a system loop.
type TileSet ¶
type TileSet struct {
// contains filtered or unexported fields
}
TileSet is a drawable that efficiently draws tiles in a 2d array
func GetTileSetComponentData ¶
func GetTileSetComponentData(w ecs.BaseWorld, e ecs.Entity) *TileSet
GetTileSetComponentData gets the *TileSet of Entity e
func NewTileSet ¶
func (*TileSet) SetColsRows ¶
func (*TileSet) SetDrawMask ¶
func (*TileSet) SetEnabled ¶
type TileSetComponent ¶
type TileSetComponent struct {
// contains filtered or unexported fields
}
TileSetComponent implements ecs.BaseComponent
func GetTileSetComponent ¶
func GetTileSetComponent(w ecs.BaseWorld) *TileSetComponent
GetTileSetComponent returns the instance of the component in a World
func (*TileSetComponent) Data ¶
func (c *TileSetComponent) Data(e ecs.Entity) *TileSet
func (TileSetComponent) Name ¶
func (TileSetComponent) Name() string
Name implements ecs.BaseComponent
func (*TileSetComponent) Remove ¶
func (c *TileSetComponent) Remove(e ecs.Entity)
Remove a TileSet data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*TileSetComponent) Setup ¶
func (c *TileSetComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (TileSetComponent) UUID ¶
func (TileSetComponent) UUID() string
UUID implements ecs.BaseComponent
func (*TileSetComponent) Upsert ¶
func (c *TileSetComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetTileSetComponentData to change component data outside of a system loop.
type TiledAnimation ¶
type TiledAnimation struct {
Clips []TiledAnimationClip
}
TiledAnimation is an animation of a single image source and many Rectangles that represent views (subimages)
func (*TiledAnimation) Count ¶
func (a *TiledAnimation) Count() int
Count returns the total count of cnimation clips
func (*TiledAnimation) Each ¶
func (a *TiledAnimation) Each(fn func(i int, clip AnimationClip) bool)
Each iterates through all animation clips
func (*TiledAnimation) GetClip ¶
func (a *TiledAnimation) GetClip(index int) AnimationClip
GetClip returns an animation clip by index
func (*TiledAnimation) GetClipEvents ¶
func (a *TiledAnimation) GetClipEvents(index int) []*AnimationEvent
GetClipEvents returns all animation clip events by the clip index
func (*TiledAnimation) GetClipImage ¶
func (a *TiledAnimation) GetClipImage(clipi, frame int) *ebiten.Image
GetClipImage returns the clip image
func (*TiledAnimation) GetClipOffset ¶
func (a *TiledAnimation) GetClipOffset(clipi, frame int) (x, y float64)
GetClipOffset returns the clip offset
func (*TiledAnimation) GetClipRect ¶
func (a *TiledAnimation) GetClipRect(clipi, frame int) image.Rectangle
GetClipRect returns the clip Rectangle (bounds)
type TiledAnimationClip ¶
type TiledAnimationClip struct { // The name of an animation is not allowed to be changed during runtime // but since this is part of a component (and components shouldn't have logic), // it is a public member. Name string Image *ebiten.Image Frames []image.Rectangle Events []*AnimationEvent //TODO: link Fps float64 ClipMode AnimClipMode EndedEvent *AnimationEvent //TODO: link }
TiledAnimationClip is an animation clip, like a character walk cycle.
func (TiledAnimationClip) GetEndedEvent ¶
func (c TiledAnimationClip) GetEndedEvent() *AnimationEvent
func (TiledAnimationClip) GetEvents ¶
func (c TiledAnimationClip) GetEvents() []*AnimationEvent
func (TiledAnimationClip) GetFPS ¶
func (c TiledAnimationClip) GetFPS() float64
func (TiledAnimationClip) GetFrameCount ¶
func (c TiledAnimationClip) GetFrameCount() int
func (TiledAnimationClip) GetMode ¶
func (c TiledAnimationClip) GetMode() AnimClipMode
func (TiledAnimationClip) GetName ¶
func (c TiledAnimationClip) GetName() string
GetName returns the animation clip name
func (TiledAnimationClip) GetOffset ¶
func (c TiledAnimationClip) GetOffset(frame int) (x, y float64)
GetOffset is anoop for TiledAnimationClip
type VIDrawLayerDrawableSystem ¶
type VIDrawLayerDrawableSystem struct { Entity ecs.Entity Drawable Drawable DrawLayer *DrawLayer Transform *components.Transform }
type VIDrawableTextLabelSystem ¶
type VIDrawableTextLabelSystem struct { Entity ecs.Entity TextLabel *TextLabel Transform *components.Transform }
type VIParticleEmitterSystem ¶
type VIParticleEmitterSystem struct { Entity ecs.Entity ParticleEmitter *ParticleEmitter Transform *components.Transform }
type VISoloDrawableSystem ¶
type VISoloDrawableSystem struct { Entity ecs.Entity Drawable Drawable Transform *components.Transform }
type VISpriteAnimationSystem ¶
type VISpriteAnimationSystem struct { Entity ecs.Entity Sprite *Sprite SpriteAnimation *SpriteAnimation }
type WatchDrawLayer ¶
type WatchDrawLayer interface { Entity() ecs.Entity Data() *DrawLayer }
WatchDrawLayer is a helper struct to access a valid pointer of DrawLayer
func WatchDrawLayerComponentData ¶
func WatchDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity) WatchDrawLayer
WatchDrawLayerComponentData gets a pointer getter of an entity's DrawLayer.
The pointer must not be stored because it may become invalid overtime.
type WatchParticleEmitter ¶
type WatchParticleEmitter interface { Entity() ecs.Entity Data() *ParticleEmitter }
WatchParticleEmitter is a helper struct to access a valid pointer of ParticleEmitter
func WatchParticleEmitterComponentData ¶
func WatchParticleEmitterComponentData(w ecs.BaseWorld, e ecs.Entity) WatchParticleEmitter
WatchParticleEmitterComponentData gets a pointer getter of an entity's ParticleEmitter.
The pointer must not be stored because it may become invalid overtime.
type WatchSprite ¶
type WatchSprite interface { Entity() ecs.Entity Data() *Sprite }
WatchSprite is a helper struct to access a valid pointer of Sprite
func WatchSpriteComponentData ¶
func WatchSpriteComponentData(w ecs.BaseWorld, e ecs.Entity) WatchSprite
WatchSpriteComponentData gets a pointer getter of an entity's Sprite.
The pointer must not be stored because it may become invalid overtime.
type WatchSpriteAnimation ¶
type WatchSpriteAnimation interface { Entity() ecs.Entity Data() *SpriteAnimation }
WatchSpriteAnimation is a helper struct to access a valid pointer of SpriteAnimation
func WatchSpriteAnimationComponentData ¶
func WatchSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity) WatchSpriteAnimation
WatchSpriteAnimationComponentData gets a pointer getter of an entity's SpriteAnimation.
The pointer must not be stored because it may become invalid overtime.
type WatchTextLabel ¶
type WatchTextLabel interface { Entity() ecs.Entity Data() *TextLabel }
WatchTextLabel is a helper struct to access a valid pointer of TextLabel
func WatchTextLabelComponentData ¶
func WatchTextLabelComponentData(w ecs.BaseWorld, e ecs.Entity) WatchTextLabel
WatchTextLabelComponentData gets a pointer getter of an entity's TextLabel.
The pointer must not be stored because it may become invalid overtime.
type WatchTileSet ¶
type WatchTileSet interface { Entity() ecs.Entity Data() *TileSet }
WatchTileSet is a helper struct to access a valid pointer of TileSet
func WatchTileSetComponentData ¶
func WatchTileSetComponentData(w ecs.BaseWorld, e ecs.Entity) WatchTileSet
WatchTileSetComponentData gets a pointer getter of an entity's TileSet.
The pointer must not be stored because it may become invalid overtime.
Source Files ¶
- animation.go
- drawable.go
- drawable_layersystem.go
- drawable_solosystem.go
- drawlayer.go
- drawlayer_component.go
- particleemitter_component.go
- particleemitter_drawablesystem.go
- particles.go
- sprite.go
- sprite_component.go
- spriteanimation.go
- spriteanimation_component.go
- spriteanimation_system.go
- textlabel.go
- textlabel_component.go
- textlabel_drawablesystem.go
- tileset.go
- tileset_component.go