Documentation ¶
Overview ¶
Package core contains lower level component systems.
Index ¶
- Constants
- Variables
- func Clamp(x, min, max float64) float64
- func SetDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity, data DrawLayer)
- func SetDrawableComponentData(w ecs.BaseWorld, e ecs.Entity, data Drawable)
- func SetFunctionComponentData(w ecs.BaseWorld, e ecs.Entity, data Function)
- func SetLabelComponentData(w ecs.BaseWorld, e ecs.Entity, data Label)
- func SetSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity, data SpriteAnimation)
- func SetSpriteComponentData(w ecs.BaseWorld, e ecs.Entity, data Sprite)
- func SetTileSetComponentData(w ecs.BaseWorld, e ecs.Entity, data TileSet)
- func SetTransformComponentData(w ecs.BaseWorld, e ecs.Entity, data Transform)
- 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 ColorMatrix
- type Context
- type DrawCtx
- type DrawFn
- 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 DrawCtx)
- func (s *DrawLayerDrawableSystem) DrawPriority(ctx 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 UpdateCtx)
- func (s *DrawLayerDrawableSystem) UpdatePriority(ctx UpdateCtx)
- func (s *DrawLayerDrawableSystem) V() *viewDrawLayerDrawableSystem
- type DrawManager
- type Drawable
- type DrawableComponent
- func (c *DrawableComponent) Data(e ecs.Entity) *Drawable
- func (c *DrawableComponent) Flag() ecs.Flag
- func (DrawableComponent) Name() string
- func (c *DrawableComponent) Remove(e ecs.Entity)
- func (c *DrawableComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (DrawableComponent) UUID() string
- func (c *DrawableComponent) Upsert(e ecs.Entity, data interface{})
- type DrawableLabelSystem
- func (s *DrawableLabelSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableLabelSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableLabelSystem) ComponentResized(cflag ecs.Flag)
- func (s *DrawableLabelSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *DrawableLabelSystem) Disable()
- func (s *DrawableLabelSystem) Draw(ctx DrawCtx)
- func (s *DrawableLabelSystem) DrawPriority(ctx DrawCtx)
- func (s *DrawableLabelSystem) Enable()
- func (s *DrawableLabelSystem) Enabled() bool
- func (DrawableLabelSystem) Name() string
- func (*DrawableLabelSystem) Priority() int64
- func (s *DrawableLabelSystem) Setup(w ecs.BaseWorld)
- func (DrawableLabelSystem) UUID() string
- func (s *DrawableLabelSystem) Update(ctx UpdateCtx)
- func (s *DrawableLabelSystem) UpdatePriority(ctx UpdateCtx)
- func (s *DrawableLabelSystem) V() *viewDrawableLabelSystem
- type DrawableObj
- type DrawableSpriteSystem
- func (s *DrawableSpriteSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableSpriteSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableSpriteSystem) ComponentResized(cflag ecs.Flag)
- func (s *DrawableSpriteSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *DrawableSpriteSystem) Disable()
- func (s *DrawableSpriteSystem) Draw(ctx DrawCtx)
- func (s *DrawableSpriteSystem) DrawPriority(ctx DrawCtx)
- func (s *DrawableSpriteSystem) Enable()
- func (s *DrawableSpriteSystem) Enabled() bool
- func (DrawableSpriteSystem) Name() string
- func (*DrawableSpriteSystem) Priority() int64
- func (s *DrawableSpriteSystem) Setup(w ecs.BaseWorld)
- func (DrawableSpriteSystem) UUID() string
- func (s *DrawableSpriteSystem) Update(ctx UpdateCtx)
- func (s *DrawableSpriteSystem) UpdatePriority(ctx UpdateCtx)
- func (s *DrawableSpriteSystem) V() *viewDrawableSpriteSystem
- type DrawableTileSetSystem
- func (s *DrawableTileSetSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableTileSetSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableTileSetSystem) ComponentResized(cflag ecs.Flag)
- func (s *DrawableTileSetSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *DrawableTileSetSystem) Disable()
- func (s *DrawableTileSetSystem) Draw(ctx DrawCtx)
- func (s *DrawableTileSetSystem) DrawPriority(ctx DrawCtx)
- func (s *DrawableTileSetSystem) Enable()
- func (s *DrawableTileSetSystem) Enabled() bool
- func (DrawableTileSetSystem) Name() string
- func (*DrawableTileSetSystem) Priority() int64
- func (s *DrawableTileSetSystem) Setup(w ecs.BaseWorld)
- func (DrawableTileSetSystem) UUID() string
- func (s *DrawableTileSetSystem) Update(ctx UpdateCtx)
- func (s *DrawableTileSetSystem) UpdatePriority(ctx UpdateCtx)
- func (s *DrawableTileSetSystem) V() *viewDrawableTileSetSystem
- type DrawableTransformSystem
- func (s *DrawableTransformSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableTransformSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *DrawableTransformSystem) ComponentResized(cflag ecs.Flag)
- func (s *DrawableTransformSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *DrawableTransformSystem) Disable()
- func (s *DrawableTransformSystem) Draw(ctx DrawCtx)
- func (s *DrawableTransformSystem) DrawPriority(ctx DrawCtx)
- func (s *DrawableTransformSystem) Enable()
- func (s *DrawableTransformSystem) Enabled() bool
- func (DrawableTransformSystem) Name() string
- func (*DrawableTransformSystem) Priority() int64
- func (s *DrawableTransformSystem) Setup(w ecs.BaseWorld)
- func (DrawableTransformSystem) UUID() string
- func (s *DrawableTransformSystem) Update(ctx UpdateCtx)
- func (s *DrawableTransformSystem) UpdatePriority(ctx UpdateCtx)
- func (s *DrawableTransformSystem) V() *viewDrawableTransformSystem
- type Engine
- type EntitySet
- type EntitySortedList
- func (sl *EntitySortedList) AddOrUpdate(key ecs.Entity, value SLVal) bool
- func (sl *EntitySortedList) Delete(key ecs.Entity) bool
- func (sl *EntitySortedList) Each(fn func(key ecs.Entity, value SLVal) bool)
- func (sl *EntitySortedList) FirstValue() SLVal
- func (sl *EntitySortedList) Get(key ecs.Entity) (SLVal, bool)
- func (sl *EntitySortedList) LastValue() SLVal
- func (sl *EntitySortedList) Reset()
- type Event
- type EventFn
- type EventID
- type EventManager
- type Function
- type FunctionComponent
- func (c *FunctionComponent) Data(e ecs.Entity) *Function
- func (c *FunctionComponent) Flag() ecs.Flag
- func (FunctionComponent) Name() string
- func (c *FunctionComponent) Remove(e ecs.Entity)
- func (c *FunctionComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (FunctionComponent) UUID() string
- func (c *FunctionComponent) Upsert(e ecs.Entity, data interface{})
- type FunctionSystem
- func (s *FunctionSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *FunctionSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *FunctionSystem) ComponentResized(cflag ecs.Flag)
- func (s *FunctionSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *FunctionSystem) Disable()
- func (s *FunctionSystem) Draw(ctx DrawCtx)
- func (s *FunctionSystem) DrawPriority(ctx DrawCtx)
- func (s *FunctionSystem) Enable()
- func (s *FunctionSystem) Enabled() bool
- func (FunctionSystem) Name() string
- func (*FunctionSystem) Priority() int64
- func (s *FunctionSystem) Setup(w ecs.BaseWorld)
- func (FunctionSystem) UUID() string
- func (s *FunctionSystem) Update(ctx UpdateCtx)
- func (s *FunctionSystem) UpdatePriority(ctx UpdateCtx)
- func (s *FunctionSystem) V() *viewFunctionSystem
- type GameWorld
- type GeoMatrix
- type Label
- func (l *Label) ComputedSize() image.Point
- func (l *Label) Draw(ctx DrawCtx, d *Drawable)
- func (l *Label) FontFaceHeight() int
- func (l *Label) ResetTextOffset()
- func (l *Label) SetColor(c color.Color) *Label
- func (l *Label) SetFaceOffset(x, y int) *Label
- func (l *Label) SetFaceOffsetModeAuto(auto bool) *Label
- func (l *Label) SetFilter(f ebiten.Filter)
- func (l *Label) SetOrigin(ox, oy float64) *Label
- func (l *Label) SetText(t string) *Label
- type LabelComponent
- func (c *LabelComponent) Data(e ecs.Entity) *Label
- func (c *LabelComponent) Flag() ecs.Flag
- func (LabelComponent) Name() string
- func (c *LabelComponent) Remove(e ecs.Entity)
- func (c *LabelComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (LabelComponent) UUID() string
- func (c *LabelComponent) Upsert(e ecs.Entity, data interface{})
- type LayerIndex
- type LayerTuple
- type Observer
- 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 SLVal
- type SetBase
- 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 DrawCtx)
- func (s *SoloDrawableSystem) DrawPriority(ctx 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 UpdateCtx)
- func (s *SoloDrawableSystem) UpdatePriority(ctx UpdateCtx)
- func (s *SoloDrawableSystem) V() *viewSoloDrawableSystem
- type Sprite
- func (s *Sprite) Angle() float64
- func (s *Sprite) Draw(ctx DrawCtx, d *Drawable)
- 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) ScaleX() float64
- func (s *Sprite) ScaleY() float64
- func (s *Sprite) SetAngle(r float64) *Sprite
- func (s *Sprite) SetCompositeMode(mode ebiten.CompositeMode)
- 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) SetScaleX(sx float64) *Sprite
- func (s *Sprite) SetScaleY(sy float64) *Sprite
- func (s *Sprite) SetX(x float64) *Sprite
- func (s *Sprite) SetY(y float64) *Sprite
- func (s *Sprite) X() float64
- func (s *Sprite) Y() float64
- 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 DrawCtx)
- func (s *SpriteAnimationSystem) DrawPriority(ctx 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 UpdateCtx)
- func (s *SpriteAnimationSystem) UpdatePriority(ctx 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 System
- type TileSet
- func (s *TileSet) Angle() float64
- func (t *TileSet) Draw(ctx DrawCtx, d *Drawable)
- func (s *TileSet) Origin() (ox, oy float64)
- func (s *TileSet) ScaleX() float64
- func (s *TileSet) ScaleY() float64
- func (s *TileSet) SetAngle(r float64) *TileSet
- 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) SetEnabled(enabled bool) *TileSet
- func (s *TileSet) SetOffset(x, y float64) *TileSet
- func (s *TileSet) SetOrigin(ox, oy float64) *TileSet
- func (s *TileSet) SetScaleX(sx float64) *TileSet
- func (s *TileSet) SetScaleY(sy float64) *TileSet
- func (s *TileSet) SetX(x float64) *TileSet
- func (s *TileSet) SetY(y float64) *TileSet
- func (s *TileSet) X() float64
- func (s *TileSet) Y() float64
- 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 Transform
- func (t *Transform) Angle() float64
- func (t *Transform) Parent() ecs.Entity
- func (t *Transform) ParentTransform() *Transform
- func (t *Transform) Scale() (sx, sy float64)
- func (t *Transform) ScaleX() float64
- func (t *Transform) ScaleY() float64
- func (t *Transform) SetAngle(r float64) *Transform
- func (t *Transform) SetParent(e ecs.Entity) bool
- func (t *Transform) SetScale(sx, sy float64) *Transform
- func (t *Transform) SetScaleX(sx float64) *Transform
- func (t *Transform) SetScaleY(sy float64) *Transform
- func (t *Transform) SetX(x float64) *Transform
- func (t *Transform) SetY(y float64) *Transform
- func (t *Transform) X() float64
- func (t *Transform) Y() float64
- type TransformComponent
- func (c *TransformComponent) Data(e ecs.Entity) *Transform
- func (c *TransformComponent) Flag() ecs.Flag
- func (TransformComponent) Name() string
- func (c *TransformComponent) Remove(e ecs.Entity)
- func (c *TransformComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (TransformComponent) UUID() string
- func (c *TransformComponent) Upsert(e ecs.Entity, data interface{})
- type TransformSystem
- func (s *TransformSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *TransformSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *TransformSystem) ComponentResized(cflag ecs.Flag)
- func (s *TransformSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *TransformSystem) Disable()
- func (s *TransformSystem) Draw(ctx DrawCtx)
- func (s *TransformSystem) DrawPriority(ctx DrawCtx)
- func (s *TransformSystem) Enable()
- func (s *TransformSystem) Enabled() bool
- func (TransformSystem) Name() string
- func (*TransformSystem) Priority() int64
- func (s *TransformSystem) Setup(w ecs.BaseWorld)
- func (TransformSystem) UUID() string
- func (s *TransformSystem) Update(ctx UpdateCtx)
- func (s *TransformSystem) UpdatePriority(ctx UpdateCtx)
- func (s *TransformSystem) V() *viewTransformSystem
- type UpdateCtx
- type UpdateFn
- type VIDrawLayerDrawableSystem
- type VIDrawableLabelSystem
- type VIDrawableSpriteSystem
- type VIDrawableTileSetSystem
- type VIDrawableTransformSystem
- type VIFunctionSystem
- type VISoloDrawableSystem
- type VISpriteAnimationSystem
- type VITransformSystem
- type WatchDrawLayer
- type WatchDrawable
- type WatchFunction
- type WatchLabel
- type WatchSprite
- type WatchSpriteAnimation
- type WatchTileSet
- type WatchTransform
- type World
Constants ¶
Variables ¶
var ( // DebugDraw enables to see debug lines and stats DebugDraw = false )
Functions ¶
func Clamp ¶
Clamp returns x clamped to the interval [min, max].
If x is less than min, min is returned. If x is more than max, max is returned. Otherwise, x is returned.
func SetDrawLayerComponentData ¶ added in v0.5.0
func SetDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity, data DrawLayer)
SetDrawLayerComponentData updates/adds a DrawLayer to Entity e
func SetDrawableComponentData ¶ added in v0.5.0
func SetDrawableComponentData(w ecs.BaseWorld, e ecs.Entity, data Drawable)
SetDrawableComponentData updates/adds a Drawable to Entity e
func SetFunctionComponentData ¶ added in v0.5.0
func SetFunctionComponentData(w ecs.BaseWorld, e ecs.Entity, data Function)
SetFunctionComponentData updates/adds a Function to Entity e
func SetLabelComponentData ¶ added in v0.5.0
func SetLabelComponentData(w ecs.BaseWorld, e ecs.Entity, data Label)
SetLabelComponentData updates/adds a Label to Entity e
func SetSpriteAnimationComponentData ¶ added in v0.5.0
func SetSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity, data SpriteAnimation)
SetSpriteAnimationComponentData updates/adds a SpriteAnimation to Entity e
func SetSpriteComponentData ¶ added in v0.5.0
func SetSpriteComponentData(w ecs.BaseWorld, e ecs.Entity, data Sprite)
SetSpriteComponentData updates/adds a Sprite to Entity e
func SetTileSetComponentData ¶ added in v0.5.0
func SetTileSetComponentData(w ecs.BaseWorld, e ecs.Entity, data TileSet)
SetTileSetComponentData updates/adds a TileSet to Entity e
func SetTransformComponentData ¶ added in v0.5.0
func SetTransformComponentData(w ecs.BaseWorld, e ecs.Entity, data Transform)
SetTransformComponentData updates/adds a Transform 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 ¶ added in v0.3.0
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 ¶ added in v0.3.0
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 ¶ added in v0.3.0
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 ColorMatrix ¶ added in v0.4.0
type ColorMatrix interface { Reset() ColorMatrix M() *ebiten.ColorM MV() ebiten.ColorM RotateHue(theta float64) ColorMatrix ChangeHSV(hueTheta float64, saturationScale float64, valueScale float64) ColorMatrix Apply(clr color.Color) ColorMatrix }
func ColorM ¶ added in v0.4.0
func ColorM() ColorMatrix
func ColorM2 ¶ added in v0.4.0
func ColorM2(m ebiten.ColorM) ColorMatrix
func ColorTint ¶ added in v0.4.0
func ColorTint(c color.Color) ColorMatrix
type DrawCtx ¶ added in v0.5.0
type DrawCtx interface { Context Renderer() DrawManager }
DrawCtx is the context passed to every system update function.
type DrawLayer ¶
type DrawLayer struct { Layer LayerIndex ZIndex int64 // contains filtered or unexported fields }
func GetDrawLayerComponentData ¶ added in v0.5.0
func GetDrawLayerComponentData(w ecs.BaseWorld, e ecs.Entity) *DrawLayer
GetDrawLayerComponentData gets the *DrawLayer of Entity e
type DrawLayerComponent ¶ added in v0.5.0
type DrawLayerComponent struct {
// contains filtered or unexported fields
}
DrawLayerComponent implements ecs.BaseComponent
func GetDrawLayerComponent ¶ added in v0.5.0
func GetDrawLayerComponent(w ecs.BaseWorld) *DrawLayerComponent
GetDrawLayerComponent returns the instance of the component in a World
func (*DrawLayerComponent) Data ¶ added in v0.5.0
func (c *DrawLayerComponent) Data(e ecs.Entity) *DrawLayer
func (*DrawLayerComponent) Flag ¶ added in v0.5.0
func (c *DrawLayerComponent) Flag() ecs.Flag
Flag returns the
func (DrawLayerComponent) Name ¶ added in v0.5.0
func (DrawLayerComponent) Name() string
Name implements ecs.BaseComponent
func (*DrawLayerComponent) Remove ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (DrawLayerComponent) UUID() string
UUID implements ecs.BaseComponent
func (*DrawLayerComponent) Upsert ¶ added in v0.5.0
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 ¶ added in v0.5.0
type DrawLayerDrawableSystem struct {
// contains filtered or unexported fields
}
DrawLayerDrawableSystem implements ecs.BaseSystem
func GetDrawLayerDrawableSystem ¶ added in v0.5.0
func GetDrawLayerDrawableSystem(w ecs.BaseWorld) *DrawLayerDrawableSystem
GetDrawLayerDrawableSystem returns the instance of the system in a World
func (*DrawLayerDrawableSystem) ComponentAdded ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawLayerDrawableSystem) ComponentRemoved ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawLayerDrawableSystem) ComponentResized ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) ComponentResized(cflag ecs.Flag)
func (*DrawLayerDrawableSystem) ComponentWillResize ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawLayerDrawableSystem) Disable ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) Disable()
Disable system
func (*DrawLayerDrawableSystem) Draw ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) Draw(ctx DrawCtx)
Draw draws a drawable by its layer and zindex order
func (*DrawLayerDrawableSystem) DrawPriority ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) DrawPriority(ctx DrawCtx)
DrawPriority is noop as of now
func (*DrawLayerDrawableSystem) Enable ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) Enable()
Enable system
func (*DrawLayerDrawableSystem) Enabled ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) Enabled() bool
Enabled checks if enabled
func (DrawLayerDrawableSystem) Name ¶ added in v0.5.0
func (DrawLayerDrawableSystem) Name() string
func (*DrawLayerDrawableSystem) Priority ¶ added in v0.5.0
func (*DrawLayerDrawableSystem) Priority() int64
func (*DrawLayerDrawableSystem) Setup ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) Setup(w ecs.BaseWorld)
func (DrawLayerDrawableSystem) UUID ¶ added in v0.5.0
func (DrawLayerDrawableSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawLayerDrawableSystem) Update ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) Update(ctx UpdateCtx)
Update is noop as of now
func (*DrawLayerDrawableSystem) UpdatePriority ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority updates layer changes
func (*DrawLayerDrawableSystem) V ¶ added in v0.5.0
func (s *DrawLayerDrawableSystem) V() *viewDrawLayerDrawableSystem
type DrawManager ¶ added in v0.4.0
type DrawManager interface { DrawImageXY(image *ebiten.Image, x, y float64) DrawImage(image *ebiten.Image, m GeoMatrix) DrawImageC(image *ebiten.Image, m GeoMatrix, c ColorMatrix) DrawImageComp(image *ebiten.Image, m GeoMatrix, mode ebiten.CompositeMode) DrawImageCComp(image *ebiten.Image, m GeoMatrix, c ColorMatrix, mode ebiten.CompositeMode) DrawImageRaw(image *ebiten.Image, opt *ebiten.DrawImageOptions) Screen() *ebiten.Image }
type Drawable ¶
type Drawable struct {
// contains filtered or unexported fields
}
Drawable is the component that controls drawing to the ebiten screen
func GetDrawableComponentData ¶ added in v0.5.0
func GetDrawableComponentData(w ecs.BaseWorld, e ecs.Entity) *Drawable
GetDrawableComponentData gets the *Drawable of Entity e
func (*Drawable) G ¶ added in v0.5.0
G returns the concatm (if set by a *Transform) or a pre calculated matrix using sx, sy (scale) r (radians) x, y position
func (*Drawable) SetConcatM ¶ added in v0.5.0
type DrawableComponent ¶ added in v0.5.0
type DrawableComponent struct {
// contains filtered or unexported fields
}
DrawableComponent implements ecs.BaseComponent
func GetDrawableComponent ¶ added in v0.5.0
func GetDrawableComponent(w ecs.BaseWorld) *DrawableComponent
GetDrawableComponent returns the instance of the component in a World
func (*DrawableComponent) Data ¶ added in v0.5.0
func (c *DrawableComponent) Data(e ecs.Entity) *Drawable
func (*DrawableComponent) Flag ¶ added in v0.5.0
func (c *DrawableComponent) Flag() ecs.Flag
Flag returns the
func (DrawableComponent) Name ¶ added in v0.5.0
func (DrawableComponent) Name() string
Name implements ecs.BaseComponent
func (*DrawableComponent) Remove ¶ added in v0.5.0
func (c *DrawableComponent) Remove(e ecs.Entity)
Remove a Drawable data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*DrawableComponent) Setup ¶ added in v0.5.0
func (c *DrawableComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (DrawableComponent) UUID ¶ added in v0.5.0
func (DrawableComponent) UUID() string
UUID implements ecs.BaseComponent
func (*DrawableComponent) Upsert ¶ added in v0.5.0
func (c *DrawableComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetDrawableComponentData to change component data outside of a system loop.
type DrawableLabelSystem ¶ added in v0.5.0
type DrawableLabelSystem struct {
// contains filtered or unexported fields
}
DrawableLabelSystem implements ecs.BaseSystem
func GetDrawableLabelSystem ¶ added in v0.5.0
func GetDrawableLabelSystem(w ecs.BaseWorld) *DrawableLabelSystem
GetDrawableLabelSystem returns the instance of the system in a World
func (*DrawableLabelSystem) ComponentAdded ¶ added in v0.5.0
func (s *DrawableLabelSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawableLabelSystem) ComponentRemoved ¶ added in v0.5.0
func (s *DrawableLabelSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawableLabelSystem) ComponentResized ¶ added in v0.5.0
func (s *DrawableLabelSystem) ComponentResized(cflag ecs.Flag)
func (*DrawableLabelSystem) ComponentWillResize ¶ added in v0.5.0
func (s *DrawableLabelSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawableLabelSystem) Disable ¶ added in v0.5.0
func (s *DrawableLabelSystem) Disable()
Disable system
func (*DrawableLabelSystem) Draw ¶ added in v0.5.0
func (s *DrawableLabelSystem) Draw(ctx DrawCtx)
Draw noop (drawing is controlled by *Drawable)
func (*DrawableLabelSystem) DrawPriority ¶ added in v0.5.0
func (s *DrawableLabelSystem) DrawPriority(ctx DrawCtx)
DrawPriority noop
func (*DrawableLabelSystem) Enable ¶ added in v0.5.0
func (s *DrawableLabelSystem) Enable()
Enable system
func (*DrawableLabelSystem) Enabled ¶ added in v0.5.0
func (s *DrawableLabelSystem) Enabled() bool
Enabled checks if enabled
func (DrawableLabelSystem) Name ¶ added in v0.5.0
func (DrawableLabelSystem) Name() string
func (*DrawableLabelSystem) Priority ¶ added in v0.5.0
func (*DrawableLabelSystem) Priority() int64
func (*DrawableLabelSystem) Setup ¶ added in v0.5.0
func (s *DrawableLabelSystem) Setup(w ecs.BaseWorld)
func (DrawableLabelSystem) UUID ¶ added in v0.5.0
func (DrawableLabelSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawableLabelSystem) Update ¶ added in v0.5.0
func (s *DrawableLabelSystem) Update(ctx UpdateCtx)
Update computes labes if dirty
func (*DrawableLabelSystem) UpdatePriority ¶ added in v0.5.0
func (s *DrawableLabelSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority noop
func (*DrawableLabelSystem) V ¶ added in v0.5.0
func (s *DrawableLabelSystem) V() *viewDrawableLabelSystem
type DrawableObj ¶ added in v0.5.0
DrawableObj is the interface of a custom drawable component to use inetead of Drawable.Draw()
type DrawableSpriteSystem ¶ added in v0.5.0
type DrawableSpriteSystem struct {
// contains filtered or unexported fields
}
DrawableSpriteSystem implements ecs.BaseSystem
func GetDrawableSpriteSystem ¶ added in v0.5.0
func GetDrawableSpriteSystem(w ecs.BaseWorld) *DrawableSpriteSystem
GetDrawableSpriteSystem returns the instance of the system in a World
func (*DrawableSpriteSystem) ComponentAdded ¶ added in v0.5.0
func (s *DrawableSpriteSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawableSpriteSystem) ComponentRemoved ¶ added in v0.5.0
func (s *DrawableSpriteSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawableSpriteSystem) ComponentResized ¶ added in v0.5.0
func (s *DrawableSpriteSystem) ComponentResized(cflag ecs.Flag)
func (*DrawableSpriteSystem) ComponentWillResize ¶ added in v0.5.0
func (s *DrawableSpriteSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawableSpriteSystem) Disable ¶ added in v0.5.0
func (s *DrawableSpriteSystem) Disable()
Disable system
func (*DrawableSpriteSystem) Draw ¶ added in v0.5.0
func (s *DrawableSpriteSystem) Draw(ctx DrawCtx)
Draw noop - drawing is controlled by *Drawable
func (*DrawableSpriteSystem) DrawPriority ¶ added in v0.5.0
func (s *DrawableSpriteSystem) DrawPriority(ctx DrawCtx)
DrawPriority noop
func (*DrawableSpriteSystem) Enable ¶ added in v0.5.0
func (s *DrawableSpriteSystem) Enable()
Enable system
func (*DrawableSpriteSystem) Enabled ¶ added in v0.5.0
func (s *DrawableSpriteSystem) Enabled() bool
Enabled checks if enabled
func (DrawableSpriteSystem) Name ¶ added in v0.5.0
func (DrawableSpriteSystem) Name() string
func (*DrawableSpriteSystem) Priority ¶ added in v0.5.0
func (*DrawableSpriteSystem) Priority() int64
func (*DrawableSpriteSystem) Setup ¶ added in v0.5.0
func (s *DrawableSpriteSystem) Setup(w ecs.BaseWorld)
func (DrawableSpriteSystem) UUID ¶ added in v0.5.0
func (DrawableSpriteSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawableSpriteSystem) Update ¶ added in v0.5.0
func (s *DrawableSpriteSystem) Update(ctx UpdateCtx)
Update noop
func (*DrawableSpriteSystem) UpdatePriority ¶ added in v0.5.0
func (s *DrawableSpriteSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority noop
func (*DrawableSpriteSystem) V ¶ added in v0.5.0
func (s *DrawableSpriteSystem) V() *viewDrawableSpriteSystem
type DrawableTileSetSystem ¶ added in v0.5.0
type DrawableTileSetSystem struct {
// contains filtered or unexported fields
}
DrawableTileSetSystem implements ecs.BaseSystem
func GetDrawableTileSetSystem ¶ added in v0.5.0
func GetDrawableTileSetSystem(w ecs.BaseWorld) *DrawableTileSetSystem
GetDrawableTileSetSystem returns the instance of the system in a World
func (*DrawableTileSetSystem) ComponentAdded ¶ added in v0.5.0
func (s *DrawableTileSetSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawableTileSetSystem) ComponentRemoved ¶ added in v0.5.0
func (s *DrawableTileSetSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawableTileSetSystem) ComponentResized ¶ added in v0.5.0
func (s *DrawableTileSetSystem) ComponentResized(cflag ecs.Flag)
func (*DrawableTileSetSystem) ComponentWillResize ¶ added in v0.5.0
func (s *DrawableTileSetSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawableTileSetSystem) Disable ¶ added in v0.5.0
func (s *DrawableTileSetSystem) Disable()
Disable system
func (*DrawableTileSetSystem) Draw ¶ added in v0.5.0
func (s *DrawableTileSetSystem) Draw(ctx DrawCtx)
Draw noop (controlled by *Drawable)
func (*DrawableTileSetSystem) DrawPriority ¶ added in v0.5.0
func (s *DrawableTileSetSystem) DrawPriority(ctx DrawCtx)
DrawPriority noop
func (*DrawableTileSetSystem) Enable ¶ added in v0.5.0
func (s *DrawableTileSetSystem) Enable()
Enable system
func (*DrawableTileSetSystem) Enabled ¶ added in v0.5.0
func (s *DrawableTileSetSystem) Enabled() bool
Enabled checks if enabled
func (DrawableTileSetSystem) Name ¶ added in v0.5.0
func (DrawableTileSetSystem) Name() string
func (*DrawableTileSetSystem) Priority ¶ added in v0.5.0
func (*DrawableTileSetSystem) Priority() int64
func (*DrawableTileSetSystem) Setup ¶ added in v0.5.0
func (s *DrawableTileSetSystem) Setup(w ecs.BaseWorld)
func (DrawableTileSetSystem) UUID ¶ added in v0.5.0
func (DrawableTileSetSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawableTileSetSystem) Update ¶ added in v0.5.0
func (s *DrawableTileSetSystem) Update(ctx UpdateCtx)
Update noop TODO: remove logic
func (*DrawableTileSetSystem) UpdatePriority ¶ added in v0.5.0
func (s *DrawableTileSetSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority noop
func (*DrawableTileSetSystem) V ¶ added in v0.5.0
func (s *DrawableTileSetSystem) V() *viewDrawableTileSetSystem
type DrawableTransformSystem ¶ added in v0.5.0
type DrawableTransformSystem struct {
// contains filtered or unexported fields
}
DrawableTransformSystem implements ecs.BaseSystem
func GetDrawableTransformSystem ¶ added in v0.5.0
func GetDrawableTransformSystem(w ecs.BaseWorld) *DrawableTransformSystem
GetDrawableTransformSystem returns the instance of the system in a World
func (*DrawableTransformSystem) ComponentAdded ¶ added in v0.5.0
func (s *DrawableTransformSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*DrawableTransformSystem) ComponentRemoved ¶ added in v0.5.0
func (s *DrawableTransformSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*DrawableTransformSystem) ComponentResized ¶ added in v0.5.0
func (s *DrawableTransformSystem) ComponentResized(cflag ecs.Flag)
func (*DrawableTransformSystem) ComponentWillResize ¶ added in v0.5.0
func (s *DrawableTransformSystem) ComponentWillResize(cflag ecs.Flag)
func (*DrawableTransformSystem) Disable ¶ added in v0.5.0
func (s *DrawableTransformSystem) Disable()
Disable system
func (*DrawableTransformSystem) Draw ¶ added in v0.5.0
func (s *DrawableTransformSystem) Draw(ctx DrawCtx)
Draw noop
func (*DrawableTransformSystem) DrawPriority ¶ added in v0.5.0
func (s *DrawableTransformSystem) DrawPriority(ctx DrawCtx)
DrawPriority noop
func (*DrawableTransformSystem) Enable ¶ added in v0.5.0
func (s *DrawableTransformSystem) Enable()
Enable system
func (*DrawableTransformSystem) Enabled ¶ added in v0.5.0
func (s *DrawableTransformSystem) Enabled() bool
Enabled checks if enabled
func (DrawableTransformSystem) Name ¶ added in v0.5.0
func (DrawableTransformSystem) Name() string
func (*DrawableTransformSystem) Priority ¶ added in v0.5.0
func (*DrawableTransformSystem) Priority() int64
func (*DrawableTransformSystem) Setup ¶ added in v0.5.0
func (s *DrawableTransformSystem) Setup(w ecs.BaseWorld)
func (DrawableTransformSystem) UUID ¶ added in v0.5.0
func (DrawableTransformSystem) UUID() string
UUID implements ecs.BaseSystem
func (*DrawableTransformSystem) Update ¶ added in v0.5.0
func (s *DrawableTransformSystem) Update(ctx UpdateCtx)
Update sets the drawable transform
func (*DrawableTransformSystem) UpdatePriority ¶ added in v0.5.0
func (s *DrawableTransformSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority noop
func (*DrawableTransformSystem) V ¶ added in v0.5.0
func (s *DrawableTransformSystem) V() *viewDrawableTransformSystem
type Engine ¶
type Engine interface { NewWorld(priority int) World NewWorldWithDefaults(priority int) World RemoveWorld(w World) Run() error Ready() <-chan struct{} UpdateFrame() int64 DrawFrame() int64 Width() int Height() int AddEventListener(eventName string, fn EventFn) EventID RemoveEventListener(id EventID) bool DispatchEvent(eventName string, data interface{}) SetDebugTPS(v bool) SetScreenScale(scale float64) }
type EntitySet ¶
type EntitySet interface { Add(elements ...ecs.Entity) Remove(elements ...ecs.Entity) Contains(elements ...ecs.Entity) bool Values() []ecs.Entity SetBase }
func NewEntitySet ¶
NewEntitySet instantiates a new empty set and adds the entities (if present)
type EntitySortedList ¶
type EntitySortedList struct {
// contains filtered or unexported fields
}
func NewEntitySortedList ¶
func NewEntitySortedList(mincap int) *EntitySortedList
func (*EntitySortedList) AddOrUpdate ¶
func (sl *EntitySortedList) AddOrUpdate(key ecs.Entity, value SLVal) bool
func (*EntitySortedList) Delete ¶
func (sl *EntitySortedList) Delete(key ecs.Entity) bool
func (*EntitySortedList) Each ¶
func (sl *EntitySortedList) Each(fn func(key ecs.Entity, value SLVal) bool)
Each iterates on all entries, sorted.
Do not delete or add entries while looping (it is read locked while looping).
func (*EntitySortedList) FirstValue ¶
func (sl *EntitySortedList) FirstValue() SLVal
func (*EntitySortedList) Get ¶
func (sl *EntitySortedList) Get(key ecs.Entity) (SLVal, bool)
func (*EntitySortedList) LastValue ¶
func (sl *EntitySortedList) LastValue() SLVal
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
func (*EventManager) Deregister ¶
func (m *EventManager) Deregister(id EventID) bool
func (*EventManager) Dispatch ¶
func (m *EventManager) Dispatch(eventName string, engine Engine, data interface{})
type Function ¶ added in v0.5.0
func GetFunctionComponentData ¶ added in v0.5.0
func GetFunctionComponentData(w ecs.BaseWorld, e ecs.Entity) *Function
GetFunctionComponentData gets the *Function of Entity e
type FunctionComponent ¶ added in v0.5.0
type FunctionComponent struct {
// contains filtered or unexported fields
}
FunctionComponent implements ecs.BaseComponent
func GetFunctionComponent ¶ added in v0.5.0
func GetFunctionComponent(w ecs.BaseWorld) *FunctionComponent
GetFunctionComponent returns the instance of the component in a World
func (*FunctionComponent) Data ¶ added in v0.5.0
func (c *FunctionComponent) Data(e ecs.Entity) *Function
func (*FunctionComponent) Flag ¶ added in v0.5.0
func (c *FunctionComponent) Flag() ecs.Flag
Flag returns the
func (FunctionComponent) Name ¶ added in v0.5.0
func (FunctionComponent) Name() string
Name implements ecs.BaseComponent
func (*FunctionComponent) Remove ¶ added in v0.5.0
func (c *FunctionComponent) Remove(e ecs.Entity)
Remove a Function data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*FunctionComponent) Setup ¶ added in v0.5.0
func (c *FunctionComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (FunctionComponent) UUID ¶ added in v0.5.0
func (FunctionComponent) UUID() string
UUID implements ecs.BaseComponent
func (*FunctionComponent) Upsert ¶ added in v0.5.0
func (c *FunctionComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetFunctionComponentData to change component data outside of a system loop.
type FunctionSystem ¶ added in v0.5.0
type FunctionSystem struct {
// contains filtered or unexported fields
}
FunctionSystem implements ecs.BaseSystem
func GetFunctionSystem ¶ added in v0.5.0
func GetFunctionSystem(w ecs.BaseWorld) *FunctionSystem
GetFunctionSystem returns the instance of the system in a World
func (*FunctionSystem) ComponentAdded ¶ added in v0.5.0
func (s *FunctionSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*FunctionSystem) ComponentRemoved ¶ added in v0.5.0
func (s *FunctionSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*FunctionSystem) ComponentResized ¶ added in v0.5.0
func (s *FunctionSystem) ComponentResized(cflag ecs.Flag)
func (*FunctionSystem) ComponentWillResize ¶ added in v0.5.0
func (s *FunctionSystem) ComponentWillResize(cflag ecs.Flag)
func (*FunctionSystem) Draw ¶ added in v0.5.0
func (s *FunctionSystem) Draw(ctx DrawCtx)
func (*FunctionSystem) DrawPriority ¶ added in v0.5.0
func (s *FunctionSystem) DrawPriority(ctx DrawCtx)
func (*FunctionSystem) Enabled ¶ added in v0.5.0
func (s *FunctionSystem) Enabled() bool
Enabled checks if enabled
func (FunctionSystem) Name ¶ added in v0.5.0
func (FunctionSystem) Name() string
func (*FunctionSystem) Priority ¶ added in v0.5.0
func (*FunctionSystem) Priority() int64
func (*FunctionSystem) Setup ¶ added in v0.5.0
func (s *FunctionSystem) Setup(w ecs.BaseWorld)
func (FunctionSystem) UUID ¶ added in v0.5.0
func (FunctionSystem) UUID() string
UUID implements ecs.BaseSystem
func (*FunctionSystem) Update ¶ added in v0.5.0
func (s *FunctionSystem) Update(ctx UpdateCtx)
func (*FunctionSystem) UpdatePriority ¶ added in v0.5.0
func (s *FunctionSystem) UpdatePriority(ctx UpdateCtx)
func (*FunctionSystem) V ¶ added in v0.5.0
func (s *FunctionSystem) V() *viewFunctionSystem
type GameWorld ¶ added in v0.5.0
type GameWorld struct { *ecs.World // contains filtered or unexported fields }
type GeoMatrix ¶ added in v0.4.0
type Label ¶ added in v0.3.0
type Label struct {
// contains filtered or unexported fields
}
func GetLabelComponentData ¶ added in v0.5.0
func GetLabelComponentData(w ecs.BaseWorld, e ecs.Entity) *Label
GetLabelComponentData gets the *Label of Entity e
func (*Label) ComputedSize ¶ added in v0.3.0
ComputedSize returns the width and height of the printable area of the label
func (*Label) FontFaceHeight ¶ added in v0.3.0
FontFaceHeight returns the font height
func (*Label) ResetTextOffset ¶ added in v0.3.0
func (l *Label) ResetTextOffset()
ResetTextOffset sets the text offset to default (0, l.FontFaceHeight())
func (*Label) SetFaceOffset ¶ added in v0.5.0
func (*Label) SetFaceOffsetModeAuto ¶ added in v0.5.0
type LabelComponent ¶ added in v0.5.0
type LabelComponent struct {
// contains filtered or unexported fields
}
LabelComponent implements ecs.BaseComponent
func GetLabelComponent ¶ added in v0.5.0
func GetLabelComponent(w ecs.BaseWorld) *LabelComponent
GetLabelComponent returns the instance of the component in a World
func (*LabelComponent) Data ¶ added in v0.5.0
func (c *LabelComponent) Data(e ecs.Entity) *Label
func (*LabelComponent) Flag ¶ added in v0.5.0
func (c *LabelComponent) Flag() ecs.Flag
Flag returns the
func (LabelComponent) Name ¶ added in v0.5.0
func (LabelComponent) Name() string
Name implements ecs.BaseComponent
func (*LabelComponent) Remove ¶ added in v0.5.0
func (c *LabelComponent) Remove(e ecs.Entity)
Remove a Label data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*LabelComponent) Setup ¶ added in v0.5.0
func (c *LabelComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (LabelComponent) UUID ¶ added in v0.5.0
func (LabelComponent) UUID() string
UUID implements ecs.BaseComponent
func (*LabelComponent) Upsert ¶ added in v0.5.0
func (c *LabelComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetLabelComponentData to change component data outside of a system loop.
type LayerTuple ¶
type LayerTuple struct { Index LayerIndex Items *EntitySortedList }
LayerTuple is returned when fetching all layers
type PcAnimClip ¶ added in v0.3.0
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 ¶ added in v0.3.0
func (c PcAnimClip) GetEndedEvent() *AnimationEvent
func (PcAnimClip) GetEvents ¶ added in v0.3.0
func (c PcAnimClip) GetEvents() []*AnimationEvent
func (PcAnimClip) GetFPS ¶ added in v0.3.0
func (c PcAnimClip) GetFPS() float64
func (PcAnimClip) GetFrameCount ¶ added in v0.3.0
func (c PcAnimClip) GetFrameCount() int
func (PcAnimClip) GetMode ¶ added in v0.3.0
func (c PcAnimClip) GetMode() AnimClipMode
func (PcAnimClip) GetName ¶ added in v0.3.0
func (c PcAnimClip) GetName() string
GetName returns the animation clip name
func (PcAnimClip) GetOffset ¶ added in v0.3.0
func (c PcAnimClip) GetOffset(frame int) (x, y float64)
GetOffset returns the pixel offset (from the origin) of the current frame
type PrecomputedAnimation ¶ added in v0.3.0
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 ¶ added in v0.3.0
func (a *PrecomputedAnimation) Count() int
Count returns the total count of cnimation clips
func (*PrecomputedAnimation) Each ¶ added in v0.3.0
func (a *PrecomputedAnimation) Each(fn func(i int, clip AnimationClip) bool)
Each iterates through all animation clips
func (*PrecomputedAnimation) GetClip ¶ added in v0.3.0
func (a *PrecomputedAnimation) GetClip(index int) AnimationClip
GetClip returns an animation clip by index
func (*PrecomputedAnimation) GetClipEvents ¶ added in v0.3.0
func (a *PrecomputedAnimation) GetClipEvents(index int) []*AnimationEvent
GetClipEvents returns all animation clip events by the clip index
func (*PrecomputedAnimation) GetClipImage ¶ added in v0.3.0
func (a *PrecomputedAnimation) GetClipImage(clipi, frame int) *ebiten.Image
GetClipImage returns the clip image
func (*PrecomputedAnimation) GetClipOffset ¶ added in v0.3.0
func (a *PrecomputedAnimation) GetClipOffset(clipi, frame int) (x, y float64)
GetClipOffset returns the clip offset
func (*PrecomputedAnimation) GetClipRect ¶ added in v0.3.0
func (a *PrecomputedAnimation) GetClipRect(clipi, frame int) image.Rectangle
GetClipRect returns the clip Rectangle (bounds)
type SoloDrawableSystem ¶ added in v0.5.0
type SoloDrawableSystem struct {
// contains filtered or unexported fields
}
SoloDrawableSystem implements ecs.BaseSystem
func GetSoloDrawableSystem ¶ added in v0.5.0
func GetSoloDrawableSystem(w ecs.BaseWorld) *SoloDrawableSystem
GetSoloDrawableSystem returns the instance of the system in a World
func (*SoloDrawableSystem) ComponentAdded ¶ added in v0.5.0
func (s *SoloDrawableSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*SoloDrawableSystem) ComponentRemoved ¶ added in v0.5.0
func (s *SoloDrawableSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*SoloDrawableSystem) ComponentResized ¶ added in v0.5.0
func (s *SoloDrawableSystem) ComponentResized(cflag ecs.Flag)
func (*SoloDrawableSystem) ComponentWillResize ¶ added in v0.5.0
func (s *SoloDrawableSystem) ComponentWillResize(cflag ecs.Flag)
func (*SoloDrawableSystem) Disable ¶ added in v0.5.0
func (s *SoloDrawableSystem) Disable()
Disable system
func (*SoloDrawableSystem) Draw ¶ added in v0.5.0
func (s *SoloDrawableSystem) Draw(ctx DrawCtx)
Draw all solo drawables ordered by entity ID
func (*SoloDrawableSystem) DrawPriority ¶ added in v0.5.0
func (s *SoloDrawableSystem) DrawPriority(ctx DrawCtx)
DrawPriority is noop as of now
func (*SoloDrawableSystem) Enable ¶ added in v0.5.0
func (s *SoloDrawableSystem) Enable()
Enable system
func (*SoloDrawableSystem) Enabled ¶ added in v0.5.0
func (s *SoloDrawableSystem) Enabled() bool
Enabled checks if enabled
func (SoloDrawableSystem) Name ¶ added in v0.5.0
func (SoloDrawableSystem) Name() string
func (*SoloDrawableSystem) Priority ¶ added in v0.5.0
func (*SoloDrawableSystem) Priority() int64
func (*SoloDrawableSystem) Setup ¶ added in v0.5.0
func (s *SoloDrawableSystem) Setup(w ecs.BaseWorld)
func (SoloDrawableSystem) UUID ¶ added in v0.5.0
func (SoloDrawableSystem) UUID() string
UUID implements ecs.BaseSystem
func (*SoloDrawableSystem) Update ¶ added in v0.5.0
func (s *SoloDrawableSystem) Update(ctx UpdateCtx)
Update is noop as of now
func (*SoloDrawableSystem) UpdatePriority ¶ added in v0.5.0
func (s *SoloDrawableSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority sets v.Drawable.concatset to false on all Drawables
func (*SoloDrawableSystem) V ¶ added in v0.5.0
func (s *SoloDrawableSystem) V() *viewSoloDrawableSystem
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite is the data of a sprite component.
func GetSpriteComponentData ¶ added in v0.5.0
func GetSpriteComponentData(w ecs.BaseWorld, e ecs.Entity) *Sprite
GetSpriteComponentData gets the *Sprite of Entity e
func (*Sprite) Angle ¶
Angle gets the local angle (radians). It is overrided by the transform component.
func (*Sprite) ResetColorMatrix ¶ added in v0.5.0
func (s *Sprite) ResetColorMatrix()
func (*Sprite) SetCompositeMode ¶ added in v0.4.0
func (s *Sprite) SetCompositeMode(mode ebiten.CompositeMode)
func (*Sprite) SetEnabled ¶ added in v0.5.0
type SpriteAnimation ¶
type SpriteAnimation struct {
// contains filtered or unexported fields
}
SpriteAnimation holds the data of a sprite animation (and clips)
func GetSpriteAnimationComponentData ¶ added in v0.5.0
func GetSpriteAnimationComponentData(w ecs.BaseWorld, e ecs.Entity) *SpriteAnimation
GetSpriteAnimationComponentData gets the *SpriteAnimation of Entity e
func NewSpriteAnimation ¶ added in v0.5.0
func NewSpriteAnimation(fps float64, anim Animation) SpriteAnimation
func (*SpriteAnimation) AddEventListener ¶ added in v0.5.0
func (a *SpriteAnimation) AddEventListener(name string, fn AnimationEventFn) AnimationEventID
func (*SpriteAnimation) AddEventListenerW ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.3.0
func (a *SpriteAnimation) PlayClipIndex(i int) bool
PlayClipIndex plays a clip at index i
func (*SpriteAnimation) PlayClipIndexFrame ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (a *SpriteAnimation) RemoveEventListener(id AnimationEventID) bool
func (*SpriteAnimation) Reversed ¶ added in v0.5.0
func (a *SpriteAnimation) Reversed() bool
func (*SpriteAnimation) SetAnimation ¶ added in v0.5.0
func (a *SpriteAnimation) SetAnimation(anim Animation)
SetAnimation parses the clip map and animations
func (*SpriteAnimation) SetReversed ¶ added in v0.5.0
func (a *SpriteAnimation) SetReversed(reversed bool)
SetReversed sets "reversed". It does nothing if it's not playing.
type SpriteAnimationComponent ¶ added in v0.5.0
type SpriteAnimationComponent struct {
// contains filtered or unexported fields
}
SpriteAnimationComponent implements ecs.BaseComponent
func GetSpriteAnimationComponent ¶ added in v0.5.0
func GetSpriteAnimationComponent(w ecs.BaseWorld) *SpriteAnimationComponent
GetSpriteAnimationComponent returns the instance of the component in a World
func (*SpriteAnimationComponent) Data ¶ added in v0.5.0
func (c *SpriteAnimationComponent) Data(e ecs.Entity) *SpriteAnimation
func (*SpriteAnimationComponent) Flag ¶ added in v0.5.0
func (c *SpriteAnimationComponent) Flag() ecs.Flag
Flag returns the
func (SpriteAnimationComponent) Name ¶ added in v0.5.0
func (SpriteAnimationComponent) Name() string
Name implements ecs.BaseComponent
func (*SpriteAnimationComponent) Remove ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (SpriteAnimationComponent) UUID() string
UUID implements ecs.BaseComponent
func (*SpriteAnimationComponent) Upsert ¶ added in v0.5.0
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 ¶ added in v0.5.0
type SpriteAnimationSystem struct {
// contains filtered or unexported fields
}
SpriteAnimationSystem implements ecs.BaseSystem
func GetSpriteAnimationSystem ¶ added in v0.5.0
func GetSpriteAnimationSystem(w ecs.BaseWorld) *SpriteAnimationSystem
GetSpriteAnimationSystem returns the instance of the system in a World
func (*SpriteAnimationSystem) ComponentAdded ¶ added in v0.5.0
func (s *SpriteAnimationSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*SpriteAnimationSystem) ComponentRemoved ¶ added in v0.5.0
func (s *SpriteAnimationSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*SpriteAnimationSystem) ComponentResized ¶ added in v0.5.0
func (s *SpriteAnimationSystem) ComponentResized(cflag ecs.Flag)
func (*SpriteAnimationSystem) ComponentWillResize ¶ added in v0.5.0
func (s *SpriteAnimationSystem) ComponentWillResize(cflag ecs.Flag)
func (*SpriteAnimationSystem) Disable ¶ added in v0.5.0
func (s *SpriteAnimationSystem) Disable()
Disable system
func (*SpriteAnimationSystem) Draw ¶ added in v0.5.0
func (s *SpriteAnimationSystem) Draw(ctx DrawCtx)
Draw noop
func (*SpriteAnimationSystem) DrawPriority ¶ added in v0.5.0
func (s *SpriteAnimationSystem) DrawPriority(ctx DrawCtx)
DrawPriority noop
func (*SpriteAnimationSystem) Enable ¶ added in v0.5.0
func (s *SpriteAnimationSystem) Enable()
Enable system
func (*SpriteAnimationSystem) Enabled ¶ added in v0.5.0
func (s *SpriteAnimationSystem) Enabled() bool
Enabled checks if enabled
func (SpriteAnimationSystem) Name ¶ added in v0.5.0
func (SpriteAnimationSystem) Name() string
func (*SpriteAnimationSystem) Priority ¶ added in v0.5.0
func (*SpriteAnimationSystem) Priority() int64
func (*SpriteAnimationSystem) Setup ¶ added in v0.5.0
func (s *SpriteAnimationSystem) Setup(w ecs.BaseWorld)
func (SpriteAnimationSystem) UUID ¶ added in v0.5.0
func (SpriteAnimationSystem) UUID() string
UUID implements ecs.BaseSystem
func (*SpriteAnimationSystem) Update ¶ added in v0.5.0
func (s *SpriteAnimationSystem) Update(ctx UpdateCtx)
Update plays the animations
func (*SpriteAnimationSystem) UpdatePriority ¶ added in v0.5.0
func (s *SpriteAnimationSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority noop
func (*SpriteAnimationSystem) V ¶ added in v0.5.0
func (s *SpriteAnimationSystem) V() *viewSpriteAnimationSystem
type SpriteComponent ¶ added in v0.5.0
type SpriteComponent struct {
// contains filtered or unexported fields
}
SpriteComponent implements ecs.BaseComponent
func GetSpriteComponent ¶ added in v0.5.0
func GetSpriteComponent(w ecs.BaseWorld) *SpriteComponent
GetSpriteComponent returns the instance of the component in a World
func (*SpriteComponent) Data ¶ added in v0.5.0
func (c *SpriteComponent) Data(e ecs.Entity) *Sprite
func (*SpriteComponent) Flag ¶ added in v0.5.0
func (c *SpriteComponent) Flag() ecs.Flag
Flag returns the
func (SpriteComponent) Name ¶ added in v0.5.0
func (SpriteComponent) Name() string
Name implements ecs.BaseComponent
func (*SpriteComponent) Remove ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (SpriteComponent) UUID() string
UUID implements ecs.BaseComponent
func (*SpriteComponent) Upsert ¶ added in v0.5.0
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 TileSet ¶ added in v0.4.0
type TileSet struct {
// contains filtered or unexported fields
}
TileSet is a drawable that efficiently draws tiles in a 2d array
func GetTileSetComponentData ¶ added in v0.5.0
func GetTileSetComponentData(w ecs.BaseWorld, e ecs.Entity) *TileSet
GetTileSetComponentData gets the *TileSet of Entity e
func NewTileSet ¶ added in v0.5.0
func (*TileSet) Angle ¶ added in v0.4.0
Angle gets the local angle (radians). It is overrided by the transform component.
func (*TileSet) SetColsRows ¶ added in v0.5.0
func (*TileSet) SetEnabled ¶ added in v0.5.0
type TileSetComponent ¶ added in v0.5.0
type TileSetComponent struct {
// contains filtered or unexported fields
}
TileSetComponent implements ecs.BaseComponent
func GetTileSetComponent ¶ added in v0.5.0
func GetTileSetComponent(w ecs.BaseWorld) *TileSetComponent
GetTileSetComponent returns the instance of the component in a World
func (*TileSetComponent) Data ¶ added in v0.5.0
func (c *TileSetComponent) Data(e ecs.Entity) *TileSet
func (*TileSetComponent) Flag ¶ added in v0.5.0
func (c *TileSetComponent) Flag() ecs.Flag
Flag returns the
func (TileSetComponent) Name ¶ added in v0.5.0
func (TileSetComponent) Name() string
Name implements ecs.BaseComponent
func (*TileSetComponent) Remove ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (TileSetComponent) UUID() string
UUID implements ecs.BaseComponent
func (*TileSetComponent) Upsert ¶ added in v0.5.0
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 ¶ added in v0.3.0
type TiledAnimation struct {
Clips []TiledAnimationClip
}
TiledAnimation is an animation of a single image source and many Rectangles that represent views (subimages)
func (*TiledAnimation) Count ¶ added in v0.3.0
func (a *TiledAnimation) Count() int
Count returns the total count of cnimation clips
func (*TiledAnimation) Each ¶ added in v0.3.0
func (a *TiledAnimation) Each(fn func(i int, clip AnimationClip) bool)
Each iterates through all animation clips
func (*TiledAnimation) GetClip ¶ added in v0.3.0
func (a *TiledAnimation) GetClip(index int) AnimationClip
GetClip returns an animation clip by index
func (*TiledAnimation) GetClipEvents ¶ added in v0.3.0
func (a *TiledAnimation) GetClipEvents(index int) []*AnimationEvent
GetClipEvents returns all animation clip events by the clip index
func (*TiledAnimation) GetClipImage ¶ added in v0.3.0
func (a *TiledAnimation) GetClipImage(clipi, frame int) *ebiten.Image
GetClipImage returns the clip image
func (*TiledAnimation) GetClipOffset ¶ added in v0.3.0
func (a *TiledAnimation) GetClipOffset(clipi, frame int) (x, y float64)
GetClipOffset returns the clip offset
func (*TiledAnimation) GetClipRect ¶ added in v0.3.0
func (a *TiledAnimation) GetClipRect(clipi, frame int) image.Rectangle
GetClipRect returns the clip Rectangle (bounds)
type TiledAnimationClip ¶ added in v0.3.0
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 ¶ added in v0.3.0
func (c TiledAnimationClip) GetEndedEvent() *AnimationEvent
func (TiledAnimationClip) GetEvents ¶ added in v0.3.0
func (c TiledAnimationClip) GetEvents() []*AnimationEvent
func (TiledAnimationClip) GetFPS ¶ added in v0.3.0
func (c TiledAnimationClip) GetFPS() float64
func (TiledAnimationClip) GetFrameCount ¶ added in v0.3.0
func (c TiledAnimationClip) GetFrameCount() int
func (TiledAnimationClip) GetImage ¶ added in v0.3.0
func (c TiledAnimationClip) GetImage(frame int) *ebiten.Image
func (TiledAnimationClip) GetMode ¶ added in v0.3.0
func (c TiledAnimationClip) GetMode() AnimClipMode
func (TiledAnimationClip) GetName ¶ added in v0.3.0
func (c TiledAnimationClip) GetName() string
GetName returns the animation clip name
func (TiledAnimationClip) GetOffset ¶ added in v0.3.0
func (c TiledAnimationClip) GetOffset(frame int) (x, y float64)
GetOffset is anoop for TiledAnimationClip
type Transform ¶
type Transform struct {
// contains filtered or unexported fields
}
Transform is a hierarchy based matrix
func GetTransformComponentData ¶ added in v0.5.0
func GetTransformComponentData(w ecs.BaseWorld, e ecs.Entity) *Transform
GetTransformComponentData gets the *Transform of Entity e
func NewTransform ¶
func (*Transform) ParentTransform ¶ added in v0.5.0
type TransformComponent ¶ added in v0.5.0
type TransformComponent struct {
// contains filtered or unexported fields
}
TransformComponent implements ecs.BaseComponent
func GetTransformComponent ¶ added in v0.5.0
func GetTransformComponent(w ecs.BaseWorld) *TransformComponent
GetTransformComponent returns the instance of the component in a World
func (*TransformComponent) Data ¶ added in v0.5.0
func (c *TransformComponent) Data(e ecs.Entity) *Transform
func (*TransformComponent) Flag ¶ added in v0.5.0
func (c *TransformComponent) Flag() ecs.Flag
Flag returns the
func (TransformComponent) Name ¶ added in v0.5.0
func (TransformComponent) Name() string
Name implements ecs.BaseComponent
func (*TransformComponent) Remove ¶ added in v0.5.0
func (c *TransformComponent) Remove(e ecs.Entity)
Remove a Transform data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*TransformComponent) Setup ¶ added in v0.5.0
func (c *TransformComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (TransformComponent) UUID ¶ added in v0.5.0
func (TransformComponent) UUID() string
UUID implements ecs.BaseComponent
func (*TransformComponent) Upsert ¶ added in v0.5.0
func (c *TransformComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetTransformComponentData to change component data outside of a system loop.
type TransformSystem ¶ added in v0.5.0
type TransformSystem struct {
// contains filtered or unexported fields
}
TransformSystem implements ecs.BaseSystem
func GetTransformSystem ¶ added in v0.5.0
func GetTransformSystem(w ecs.BaseWorld) *TransformSystem
GetTransformSystem returns the instance of the system in a World
func (*TransformSystem) ComponentAdded ¶ added in v0.5.0
func (s *TransformSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*TransformSystem) ComponentRemoved ¶ added in v0.5.0
func (s *TransformSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*TransformSystem) ComponentResized ¶ added in v0.5.0
func (s *TransformSystem) ComponentResized(cflag ecs.Flag)
func (*TransformSystem) ComponentWillResize ¶ added in v0.5.0
func (s *TransformSystem) ComponentWillResize(cflag ecs.Flag)
func (*TransformSystem) Disable ¶ added in v0.5.0
func (s *TransformSystem) Disable()
Disable system
func (*TransformSystem) Draw ¶ added in v0.5.0
func (s *TransformSystem) Draw(ctx DrawCtx)
Draw noop
func (*TransformSystem) DrawPriority ¶ added in v0.5.0
func (s *TransformSystem) DrawPriority(ctx DrawCtx)
DrawPriority noop
func (*TransformSystem) Enabled ¶ added in v0.5.0
func (s *TransformSystem) Enabled() bool
Enabled checks if enabled
func (TransformSystem) Name ¶ added in v0.5.0
func (TransformSystem) Name() string
func (*TransformSystem) Priority ¶ added in v0.5.0
func (*TransformSystem) Priority() int64
func (*TransformSystem) Setup ¶ added in v0.5.0
func (s *TransformSystem) Setup(w ecs.BaseWorld)
func (TransformSystem) UUID ¶ added in v0.5.0
func (TransformSystem) UUID() string
UUID implements ecs.BaseSystem
func (*TransformSystem) Update ¶ added in v0.5.0
func (s *TransformSystem) Update(ctx UpdateCtx)
Update calculates all transform matrices
func (*TransformSystem) UpdatePriority ¶ added in v0.5.0
func (s *TransformSystem) UpdatePriority(ctx UpdateCtx)
UpdatePriority noop
func (*TransformSystem) V ¶ added in v0.5.0
func (s *TransformSystem) V() *viewTransformSystem
type UpdateCtx ¶ added in v0.5.0
type UpdateCtx interface { Context }
UpdateCtx is the context passed to every system update function.
type VIDrawLayerDrawableSystem ¶ added in v0.5.0
type VIDrawableLabelSystem ¶ added in v0.5.0
type VIDrawableSpriteSystem ¶ added in v0.5.0
type VIDrawableTileSetSystem ¶ added in v0.5.0
type VIDrawableTransformSystem ¶ added in v0.5.0
type VIFunctionSystem ¶ added in v0.5.0
type VIFunctionSystem struct { Entity ecs.Entity Function *Function }
type VISoloDrawableSystem ¶ added in v0.5.0
type VISoloDrawableSystem struct { Entity ecs.Entity Drawable *Drawable }
type VISpriteAnimationSystem ¶ added in v0.5.0
type VISpriteAnimationSystem struct { Entity ecs.Entity Sprite *Sprite SpriteAnimation *SpriteAnimation }
type VITransformSystem ¶ added in v0.5.0
type VITransformSystem struct { Entity ecs.Entity Transform *Transform }
type WatchDrawLayer ¶ added in v0.5.0
type WatchDrawLayer interface { Entity() ecs.Entity Data() *DrawLayer }
WatchDrawLayer is a helper struct to access a valid pointer of DrawLayer
func WatchDrawLayerComponentData ¶ added in v0.5.0
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 WatchDrawable ¶ added in v0.5.0
type WatchDrawable interface { Entity() ecs.Entity Data() *Drawable }
WatchDrawable is a helper struct to access a valid pointer of Drawable
func WatchDrawableComponentData ¶ added in v0.5.0
func WatchDrawableComponentData(w ecs.BaseWorld, e ecs.Entity) WatchDrawable
WatchDrawableComponentData gets a pointer getter of an entity's Drawable.
The pointer must not be stored because it may become invalid overtime.
type WatchFunction ¶ added in v0.5.0
type WatchFunction interface { Entity() ecs.Entity Data() *Function }
WatchFunction is a helper struct to access a valid pointer of Function
func WatchFunctionComponentData ¶ added in v0.5.0
func WatchFunctionComponentData(w ecs.BaseWorld, e ecs.Entity) WatchFunction
WatchFunctionComponentData gets a pointer getter of an entity's Function.
The pointer must not be stored because it may become invalid overtime.
type WatchLabel ¶ added in v0.5.0
type WatchLabel interface { Entity() ecs.Entity Data() *Label }
WatchLabel is a helper struct to access a valid pointer of Label
func WatchLabelComponentData ¶ added in v0.5.0
func WatchLabelComponentData(w ecs.BaseWorld, e ecs.Entity) WatchLabel
WatchLabelComponentData gets a pointer getter of an entity's Label.
The pointer must not be stored because it may become invalid overtime.
type WatchSprite ¶ added in v0.5.0
type WatchSprite interface { Entity() ecs.Entity Data() *Sprite }
WatchSprite is a helper struct to access a valid pointer of Sprite
func WatchSpriteComponentData ¶ added in v0.5.0
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 ¶ added in v0.5.0
type WatchSpriteAnimation interface { Entity() ecs.Entity Data() *SpriteAnimation }
WatchSpriteAnimation is a helper struct to access a valid pointer of SpriteAnimation
func WatchSpriteAnimationComponentData ¶ added in v0.5.0
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 WatchTileSet ¶ added in v0.5.0
type WatchTileSet interface { Entity() ecs.Entity Data() *TileSet }
WatchTileSet is a helper struct to access a valid pointer of TileSet
func WatchTileSetComponentData ¶ added in v0.5.0
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.
type WatchTransform ¶ added in v0.5.0
type WatchTransform interface { Entity() ecs.Entity Data() *Transform }
WatchTransform is a helper struct to access a valid pointer of Transform
func WatchTransformComponentData ¶ added in v0.5.0
func WatchTransformComponentData(w ecs.BaseWorld, e ecs.Entity) WatchTransform
WatchTransformComponentData gets a pointer getter of an entity's Transform.
The pointer must not be stored because it may become invalid overtime.
Source Files ¶
- animation.go
- context.go
- debugdraw.go
- doc.go
- drawable.go
- drawable_component.go
- drawable_layersystem.go
- drawable_solosystem.go
- drawlayer.go
- drawlayer_component.go
- drawlayer_old.go
- drawmanager.go
- ecs.go
- ecstag_old.go
- entityset.go
- eventmanager.go
- function.go
- function_component.go
- function_system.go
- label.go
- label_component.go
- label_drawablesystem.go
- math.go
- sortedlist.go
- sprite.go
- sprite_component.go
- sprite_drawablesystem.go
- spriteanimation.go
- spriteanimation_component.go
- spriteanimation_system.go
- tileset.go
- tileset_component.go
- tileset_drawablesystem.go
- transform.go
- transform_component.go
- transform_drawablesystem.go
- transform_system.go