Versions in this module Expand all Collapse all v0 v0.1.0 Apr 21, 2020 Changes in this version + const CNRepeatSprite + const CNSprite + const CNSpriteAnimation + const CNTransform + const DefaultImageOptions + const SNRepeatSprite + const SNSprite + const SNSpriteAnimation + const SNSpriteAnimationLink + const SNTransform + const SNTransformSprite + const TagDelta + var IM = Matrix + var SpriteAnimationCS *SpriteAnimationComponentSystem = new(SpriteAnimationComponentSystem) + var SpriteAnimationLinkCS *SpriteAnimationLinkComponentSystem = new(SpriteAnimationLinkComponentSystem) + var ZV = Vec + func Clamp(x, min, max float64) float64 + func NewWorld(e *Engine) *ecs.World + func RegisterComponentSystem(cs ComponentSystem) + func RepeatSpriteSystemExec(ctx Context) + func SetupSystem(w *ecs.World, cs ComponentSystem) + func SpriteAnimationLinkSystemExec(ctx Context) + func SpriteAnimationSystemExec(ctx Context) + func SpriteSystemExec(ctx Context) + func TransformSpriteSystemExec(ctx Context) + func TransformSystemExec(ctx Context) + func UpsertComponent(w ecs.Worlder, comp ecs.NewComponentInput) *ecs.Component + type AnimClipMode byte + const AnimClampForever + const AnimLoop + const AnimOnce + const AnimPingPong + type Archetype struct + Components []*ecs.Component + World *ecs.World + func NewArchetype(world *ecs.World, comps ...*ecs.Component) *Archetype + func RepeatSpriteArchetype(w *ecs.World) *Archetype + func (a *Archetype) NewEntity(compdata ...interface{}) ecs.Entity + type BaseComponentSystem struct + func (cs *BaseComponentSystem) SystemExec() SystemExecFn + func (cs *BaseComponentSystem) SystemInit() SystemInitFn + func (cs *BaseComponentSystem) SystemPriority() int + func (cs *BaseComponentSystem) SystemTags() []string + type BasicCS struct + GetComponents func(w ecs.Worlder) []*ecs.Component + SysExec SystemExecFn + SysInit SystemInitFn + SysName string + SysPriority int + SysTags []string + func (cs *BasicCS) BasicCS() int + func (cs *BasicCS) Components(w ecs.Worlder) []*ecs.Component + func (cs *BasicCS) SystemExec() SystemExecFn + func (cs *BasicCS) SystemInit() SystemInitFn + func (cs *BasicCS) SystemName() string + func (cs *BasicCS) SystemPriority() int + func (cs *BasicCS) SystemTags() []string + type ComponentSystem interface + Components func(w ecs.Worlder) []*ecs.Component + SystemExec func() SystemExecFn + SystemInit func() SystemInitFn + SystemName func() string + SystemPriority func() int + SystemTags func() []string + type Context interface + DefaultDrawImageOptions func() *ebiten.DrawImageOptions + Engine func() *Engine + FPS func() float64 + Frame func() int64 + IsDrawingSkipped func() bool + Screen func() *ebiten.Image + type Dict struct + func (d *Dict) Exists(key string) bool + func (d *Dict) Get(key string) interface{} + func (d *Dict) Set(key string, value interface{}) + type Engine struct + func NewEngine(v *NewEngineInput) *Engine + func (e *Engine) AddWorld(w *ecs.World, priority int) + func (e *Engine) Default() *ecs.World + func (e *Engine) FS() fs.Filesystem + func (e *Engine) Get(key string) interface{} + func (e *Engine) RemoveWorld(w *ecs.World) bool + func (e *Engine) Run() error + func (e *Engine) Set(key string, value interface{}) + type EngineOptions struct + Height int + Scale float64 + Title string + Width int + type Matrix [6]float64 + func (m Matrix) Chained(next Matrix) Matrix + func (m Matrix) Moved(delta Vec) Matrix + func (m Matrix) Project(u Vec) Vec + func (m Matrix) Rotated(around Vec, angle float64) Matrix + func (m Matrix) Scaled(around Vec, scale float64) Matrix + func (m Matrix) ScaledXY(around Vec, scale Vec) Matrix + func (m Matrix) String() string + func (m Matrix) Unproject(u Vec) Vec + type Middleware func(next SystemExecFn) SystemExecFn + type NewEngineInput struct + FS fs.Filesystem + Height int + Scale float64 + Title string + Width int + func (i *NewEngineInput) Options() EngineOptions + type Rect struct + Max Vec + Min Vec + func R(minX, minY, maxX, maxY float64) Rect + func (r Rect) Area() float64 + func (r Rect) Center() Vec + func (r Rect) Contains(u Vec) bool + func (r Rect) H() float64 + func (r Rect) Intersect(s Rect) Rect + func (r Rect) Moved(delta Vec) Rect + func (r Rect) Norm() Rect + func (r Rect) Resized(anchor, size Vec) Rect + func (r Rect) ResizedMin(size Vec) Rect + func (r Rect) Size() Vec + func (r Rect) String() string + func (r Rect) Union(s Rect) Rect + func (r Rect) W() float64 + type RepeatSprite struct + DrawDisabled bool + RepeatX int + RepeatY int + type RepeatSpriteComponentSystem struct + func (cs *RepeatSpriteComponentSystem) Components(w ecs.Worlder) []*ecs.Component + func (cs *RepeatSpriteComponentSystem) SystemExec() SystemExecFn + func (cs *RepeatSpriteComponentSystem) SystemName() string + func (cs *RepeatSpriteComponentSystem) SystemPriority() int + func (cs *RepeatSpriteComponentSystem) SystemTags() []string + type Sprite struct + Angle float64 + Bounds image.Rectangle + DrawDisabled bool + Image *ebiten.Image + Options *ebiten.DrawImageOptions + OriginX float64 + OriginY float64 + ScaleX float64 + ScaleY float64 + X float64 + Y float64 + func (s *Sprite) GetPrecomputedImage() *ebiten.Image + func (s *Sprite) GetPrecomputedImageDim() (width, height float64) + type SpriteAnimation struct + ActiveClip int + ActiveFrame int + Clips []SpriteAnimationClip + Enabled bool + Fps float64 + Playing bool + T float64 + func (a *SpriteAnimation) PlayClip(name string) + type SpriteAnimationClip struct + ClipMode AnimClipMode + Fps float64 + Frames []image.Rectangle + Name string + type SpriteAnimationComponentSystem struct + func (cs *SpriteAnimationComponentSystem) Components(w ecs.Worlder) []*ecs.Component + func (cs *SpriteAnimationComponentSystem) SystemExec() SystemExecFn + func (cs *SpriteAnimationComponentSystem) SystemName() string + func (cs *SpriteAnimationComponentSystem) SystemPriority() int + type SpriteAnimationLinkComponentSystem struct + func (cs *SpriteAnimationLinkComponentSystem) Components(w ecs.Worlder) []*ecs.Component + func (cs *SpriteAnimationLinkComponentSystem) SystemExec() SystemExecFn + func (cs *SpriteAnimationLinkComponentSystem) SystemName() string + func (cs *SpriteAnimationLinkComponentSystem) SystemPriority() int + func (cs *SpriteAnimationLinkComponentSystem) SystemTags() []string + type SpriteComponentSystem struct + var SpriteCS *SpriteComponentSystem = new(SpriteComponentSystem) + func (cs *SpriteComponentSystem) Components(w ecs.Worlder) []*ecs.Component + func (cs *SpriteComponentSystem) SystemExec() SystemExecFn + func (cs *SpriteComponentSystem) SystemInit() SystemInitFn + func (cs *SpriteComponentSystem) SystemName() string + func (cs *SpriteComponentSystem) SystemPriority() int + func (cs *SpriteComponentSystem) SystemTags() []string + type SystemExecFn func(ctx Context) + func SystemWrap(fn SystemExecFn, mid ...Middleware) SystemExecFn + type SystemInitFn func(w *ecs.World, sys *ecs.System) + type Transform struct + Angle float64 + M Matrix + Parent *Transform + ScaleX float64 + ScaleY float64 + X float64 + Y float64 + func NewTransform() *Transform + type TransformComponentSystem struct + func (cs *TransformComponentSystem) Components(w ecs.Worlder) []*ecs.Component + func (cs *TransformComponentSystem) SystemExec() SystemExecFn + func (cs *TransformComponentSystem) SystemInit() SystemInitFn + func (cs *TransformComponentSystem) SystemName() string + func (cs *TransformComponentSystem) SystemPriority() int + type TransformSpriteComponentSystem struct + func (cs *TransformSpriteComponentSystem) Components(w ecs.Worlder) []*ecs.Component + func (cs *TransformSpriteComponentSystem) SystemExec() SystemExecFn + func (cs *TransformSpriteComponentSystem) SystemName() string + func (cs *TransformSpriteComponentSystem) SystemPriority() int + type Vec struct + X float64 + Y float64 + func Lerp(a, b Vec, t float64) Vec + func Unit(angle float64) Vec + func V(x, y float64) Vec + func (u Vec) Add(v Vec) Vec + func (u Vec) Angle() float64 + func (u Vec) Cross(v Vec) float64 + func (u Vec) Dot(v Vec) float64 + func (u Vec) Len() float64 + func (u Vec) Map(f func(float64) float64) Vec + func (u Vec) Normal() Vec + func (u Vec) Project(v Vec) Vec + func (u Vec) Rotated(angle float64) Vec + func (u Vec) Scaled(c float64) Vec + func (u Vec) ScaledXY(v Vec) Vec + func (u Vec) String() string + func (u Vec) Sub(v Vec) Vec + func (u Vec) To(v Vec) Vec + func (u Vec) Unit() Vec + func (u Vec) XY() (x, y float64) + type WorldTag = string + const WorldTagDraw + const WorldTagUpdate