components

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAudioPlayerComponentData

func SetAudioPlayerComponentData(w ecs.BaseWorld, e ecs.Entity, data AudioPlayer)

SetAudioPlayerComponentData updates/adds a AudioPlayer to Entity e

func SetCameraComponentData

func SetCameraComponentData(w ecs.BaseWorld, e ecs.Entity, data Camera)

SetCameraComponentData updates/adds a Camera to Entity e

func SetFollowTransformComponentData

func SetFollowTransformComponentData(w ecs.BaseWorld, e ecs.Entity, data FollowTransform)

SetFollowTransformComponentData updates/adds a FollowTransform to Entity e

func SetFunctionComponentData

func SetFunctionComponentData(w ecs.BaseWorld, e ecs.Entity, data Function)

SetFunctionComponentData updates/adds a Function to Entity e

func SetTrTweeningComponentData

func SetTrTweeningComponentData(w ecs.BaseWorld, e ecs.Entity, data TrTweening)

SetTrTweeningComponentData updates/adds a TrTweening to Entity e

func SetTransformComponentData

func SetTransformComponentData(w ecs.BaseWorld, e ecs.Entity, data Transform)

SetTransformComponentData updates/adds a Transform to Entity e

Types

type AudioPlayer

type AudioPlayer struct {
	// contains filtered or unexported fields
}

func GetAudioPlayerComponentData

func GetAudioPlayerComponentData(w ecs.BaseWorld, e ecs.Entity) *AudioPlayer

GetAudioPlayerComponentData gets the *AudioPlayer of Entity e

func NewAudioPlayer

func NewAudioPlayer(input NewAudioPlayerInput) AudioPlayer

func (*AudioPlayer) Current

func (p *AudioPlayer) Current() time.Duration

func (*AudioPlayer) IsPlaying

func (p *AudioPlayer) IsPlaying() bool

func (*AudioPlayer) Pan

func (p *AudioPlayer) Pan() float64

func (*AudioPlayer) Pause

func (p *AudioPlayer) Pause()

func (*AudioPlayer) Pitch

func (p *AudioPlayer) Pitch() float64

func (*AudioPlayer) Play

func (p *AudioPlayer) Play()

func (*AudioPlayer) Rewind

func (p *AudioPlayer) Rewind() error

func (*AudioPlayer) Seek

func (p *AudioPlayer) Seek(offset time.Duration) error

func (*AudioPlayer) SetPan

func (p *AudioPlayer) SetPan(pan float64)

func (*AudioPlayer) SetPitch

func (p *AudioPlayer) SetPitch(pan float64)

func (*AudioPlayer) SetVolume

func (p *AudioPlayer) SetVolume(volume float64)

func (*AudioPlayer) Volume

func (p *AudioPlayer) Volume() float64

type AudioPlayerComponent

type AudioPlayerComponent struct {
	// contains filtered or unexported fields
}

AudioPlayerComponent implements ecs.BaseComponent

func GetAudioPlayerComponent

func GetAudioPlayerComponent(w ecs.BaseWorld) *AudioPlayerComponent

GetAudioPlayerComponent returns the instance of the component in a World

func (*AudioPlayerComponent) Data

func (c *AudioPlayerComponent) Data(e ecs.Entity) *AudioPlayer

func (*AudioPlayerComponent) Flag

func (c *AudioPlayerComponent) Flag() ecs.Flag

Flag returns the

func (AudioPlayerComponent) Name

Name implements ecs.BaseComponent

func (*AudioPlayerComponent) Remove

func (c *AudioPlayerComponent) Remove(e ecs.Entity)

Remove a AudioPlayer data from entity e

Warning: DO NOT call remove inside the system entities loop

func (*AudioPlayerComponent) Setup

func (c *AudioPlayerComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)

Setup is called by ecs.BaseWorld

Do not call this directly

func (AudioPlayerComponent) UUID

UUID implements ecs.BaseComponent

func (*AudioPlayerComponent) Upsert

func (c *AudioPlayerComponent) Upsert(e ecs.Entity, data interface{})

Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetAudioPlayerComponentData to change component data outside of a system loop.

type Camera

type Camera struct {
	// contains filtered or unexported fields
}

func GetCameraComponentData

func GetCameraComponentData(w ecs.BaseWorld, e ecs.Entity) *Camera

GetCameraComponentData gets the *Camera of Entity e

func NewCamera

func NewCamera(drawTarget core.DrawTargetID) Camera

func (*Camera) SetViewRect

func (c *Camera) SetViewRect(r geom.Vec)

type CameraComponent

type CameraComponent struct {
	// contains filtered or unexported fields
}

CameraComponent implements ecs.BaseComponent

func GetCameraComponent

func GetCameraComponent(w ecs.BaseWorld) *CameraComponent

GetCameraComponent returns the instance of the component in a World

func (*CameraComponent) Data

func (c *CameraComponent) Data(e ecs.Entity) *Camera

func (*CameraComponent) Flag

func (c *CameraComponent) Flag() ecs.Flag

Flag returns the

func (CameraComponent) Name

func (CameraComponent) Name() string

Name implements ecs.BaseComponent

func (*CameraComponent) Remove

func (c *CameraComponent) Remove(e ecs.Entity)

Remove a Camera data from entity e

Warning: DO NOT call remove inside the system entities loop

func (*CameraComponent) Setup

func (c *CameraComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)

Setup is called by ecs.BaseWorld

Do not call this directly

func (CameraComponent) UUID

func (CameraComponent) UUID() string

UUID implements ecs.BaseComponent

func (*CameraComponent) Upsert

func (c *CameraComponent) Upsert(e ecs.Entity, data interface{})

Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetCameraComponentData to change component data outside of a system loop.

type CameraRealTimeEasingFn

type CameraRealTimeEasingFn func(curp, targetp geom.Vec, dt float64) geom.Vec

type CameraSystem

type CameraSystem struct {
	// contains filtered or unexported fields
}

CameraSystem implements ecs.BaseSystem

func GetCameraSystem

func GetCameraSystem(w ecs.BaseWorld) *CameraSystem

GetCameraSystem returns the instance of the system in a World

func (*CameraSystem) ComponentAdded

func (s *CameraSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)

func (*CameraSystem) ComponentRemoved

func (s *CameraSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)

func (*CameraSystem) ComponentResized

func (s *CameraSystem) ComponentResized(cflag ecs.Flag)

func (*CameraSystem) ComponentWillResize

func (s *CameraSystem) ComponentWillResize(cflag ecs.Flag)

func (*CameraSystem) Disable

func (s *CameraSystem) Disable()

Disable system

func (*CameraSystem) Draw

func (s *CameraSystem) Draw(ctx core.DrawCtx)

Draw noop

func (*CameraSystem) DrawPriority

func (s *CameraSystem) DrawPriority(ctx core.DrawCtx)

DrawPriority noop

func (*CameraSystem) Enable

func (s *CameraSystem) Enable()

Enable system

func (*CameraSystem) Enabled

func (s *CameraSystem) Enabled() bool

Enabled checks if enabled

func (CameraSystem) Name

func (CameraSystem) Name() string

func (*CameraSystem) Priority

func (*CameraSystem) Priority() int64

func (*CameraSystem) Setup

func (s *CameraSystem) Setup(w ecs.BaseWorld)

func (CameraSystem) UUID

func (CameraSystem) UUID() string

UUID implements ecs.BaseSystem

func (*CameraSystem) Update

func (s *CameraSystem) Update(ctx core.UpdateCtx)

Update noop

func (*CameraSystem) UpdatePriority

func (s *CameraSystem) UpdatePriority(ctx core.UpdateCtx)

UpdatePriority noop

func (*CameraSystem) V

func (s *CameraSystem) V() *viewCameraSystem

type DrawFn

type DrawFn func(ctx core.DrawCtx, e ecs.Entity)

type FollowTransform

type FollowTransform struct {
	// contains filtered or unexported fields
}

func GetFollowTransformComponentData

func GetFollowTransformComponentData(w ecs.BaseWorld, e ecs.Entity) *FollowTransform

GetFollowTransformComponentData gets the *FollowTransform of Entity e

func (*FollowTransform) SetBounds

func (c *FollowTransform) SetBounds(dz geom.Rect)

func (*FollowTransform) SetDeadZone

func (c *FollowTransform) SetDeadZone(dz geom.Vec)

func (*FollowTransform) SetIsLocalOffset

func (c *FollowTransform) SetIsLocalOffset(islocal bool)

func (*FollowTransform) SetOffset

func (c *FollowTransform) SetOffset(dz geom.Rect)

func (*FollowTransform) SetTarget

func (c *FollowTransform) SetTarget(e ecs.Entity)

type FollowTransformComponent

type FollowTransformComponent struct {
	// contains filtered or unexported fields
}

FollowTransformComponent implements ecs.BaseComponent

func GetFollowTransformComponent

func GetFollowTransformComponent(w ecs.BaseWorld) *FollowTransformComponent

GetFollowTransformComponent returns the instance of the component in a World

func (*FollowTransformComponent) Data

func (c *FollowTransformComponent) Data(e ecs.Entity) *FollowTransform

func (*FollowTransformComponent) Flag

func (c *FollowTransformComponent) Flag() ecs.Flag

Flag returns the

func (FollowTransformComponent) Name

Name implements ecs.BaseComponent

func (*FollowTransformComponent) Remove

func (c *FollowTransformComponent) Remove(e ecs.Entity)

Remove a FollowTransform data from entity e

Warning: DO NOT call remove inside the system entities loop

func (*FollowTransformComponent) Setup

func (c *FollowTransformComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)

Setup is called by ecs.BaseWorld

Do not call this directly

func (FollowTransformComponent) UUID

UUID implements ecs.BaseComponent

func (*FollowTransformComponent) Upsert

func (c *FollowTransformComponent) Upsert(e ecs.Entity, data interface{})

Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetFollowTransformComponentData to change component data outside of a system loop.

type FollowTransformSystem

type FollowTransformSystem struct {
	// contains filtered or unexported fields
}

FollowTransformSystem implements ecs.BaseSystem

func GetFollowTransformSystem

func GetFollowTransformSystem(w ecs.BaseWorld) *FollowTransformSystem

GetFollowTransformSystem returns the instance of the system in a World

func (*FollowTransformSystem) ComponentAdded

func (s *FollowTransformSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)

func (*FollowTransformSystem) ComponentRemoved

func (s *FollowTransformSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)

func (*FollowTransformSystem) ComponentResized

func (s *FollowTransformSystem) ComponentResized(cflag ecs.Flag)

func (*FollowTransformSystem) ComponentWillResize

func (s *FollowTransformSystem) ComponentWillResize(cflag ecs.Flag)

func (*FollowTransformSystem) Disable

func (s *FollowTransformSystem) Disable()

Disable system

func (*FollowTransformSystem) Draw

func (s *FollowTransformSystem) Draw(ctx core.DrawCtx)

Draw noop

func (*FollowTransformSystem) DrawPriority

func (s *FollowTransformSystem) DrawPriority(ctx core.DrawCtx)

DrawPriority noop

func (*FollowTransformSystem) Enable

func (s *FollowTransformSystem) Enable()

Enable system

func (*FollowTransformSystem) Enabled

func (s *FollowTransformSystem) Enabled() bool

Enabled checks if enabled

func (FollowTransformSystem) Name

func (*FollowTransformSystem) Priority

func (*FollowTransformSystem) Priority() int64

func (*FollowTransformSystem) Setup

func (s *FollowTransformSystem) Setup(w ecs.BaseWorld)

func (FollowTransformSystem) UUID

UUID implements ecs.BaseSystem

func (*FollowTransformSystem) Update

func (s *FollowTransformSystem) Update(ctx core.UpdateCtx)

Update calculates all transform matrices

func (*FollowTransformSystem) UpdatePriority

func (s *FollowTransformSystem) UpdatePriority(ctx core.UpdateCtx)

UpdatePriority noop

func (*FollowTransformSystem) V

func (s *FollowTransformSystem) V() *viewFollowTransformSystem

type Function

type Function struct {
	DrawPriority   DrawFn
	Draw           DrawFn
	UpdatePriority UpdateFn
	Update         UpdateFn
}

func GetFunctionComponentData

func GetFunctionComponentData(w ecs.BaseWorld, e ecs.Entity) *Function

GetFunctionComponentData gets the *Function of Entity e

type FunctionComponent

type FunctionComponent struct {
	// contains filtered or unexported fields
}

FunctionComponent implements ecs.BaseComponent

func GetFunctionComponent

func GetFunctionComponent(w ecs.BaseWorld) *FunctionComponent

GetFunctionComponent returns the instance of the component in a World

func (*FunctionComponent) Data

func (c *FunctionComponent) Data(e ecs.Entity) *Function

func (*FunctionComponent) Flag

func (c *FunctionComponent) Flag() ecs.Flag

Flag returns the

func (FunctionComponent) Name

func (FunctionComponent) Name() string

Name implements ecs.BaseComponent

func (*FunctionComponent) Remove

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

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

func (FunctionComponent) UUID() string

UUID implements ecs.BaseComponent

func (*FunctionComponent) Upsert

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

type FunctionSystem struct {
	// contains filtered or unexported fields
}

FunctionSystem implements ecs.BaseSystem

func GetFunctionSystem

func GetFunctionSystem(w ecs.BaseWorld) *FunctionSystem

GetFunctionSystem returns the instance of the system in a World

func (*FunctionSystem) ComponentAdded

func (s *FunctionSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)

func (*FunctionSystem) ComponentRemoved

func (s *FunctionSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)

func (*FunctionSystem) ComponentResized

func (s *FunctionSystem) ComponentResized(cflag ecs.Flag)

func (*FunctionSystem) ComponentWillResize

func (s *FunctionSystem) ComponentWillResize(cflag ecs.Flag)

func (*FunctionSystem) Disable

func (s *FunctionSystem) Disable()

Disable system

func (*FunctionSystem) Draw

func (s *FunctionSystem) Draw(ctx core.DrawCtx)

func (*FunctionSystem) DrawPriority

func (s *FunctionSystem) DrawPriority(ctx core.DrawCtx)

func (*FunctionSystem) Enable

func (s *FunctionSystem) Enable()

Enable system

func (*FunctionSystem) Enabled

func (s *FunctionSystem) Enabled() bool

Enabled checks if enabled

func (FunctionSystem) Name

func (FunctionSystem) Name() string

func (*FunctionSystem) Priority

func (*FunctionSystem) Priority() int64

func (*FunctionSystem) Setup

func (s *FunctionSystem) Setup(w ecs.BaseWorld)

func (FunctionSystem) UUID

func (FunctionSystem) UUID() string

UUID implements ecs.BaseSystem

func (*FunctionSystem) Update

func (s *FunctionSystem) Update(ctx core.UpdateCtx)

func (*FunctionSystem) UpdatePriority

func (s *FunctionSystem) UpdatePriority(ctx core.UpdateCtx)

func (*FunctionSystem) V

func (s *FunctionSystem) V() *viewFunctionSystem

type NewAudioPlayerInput

type NewAudioPlayerInput struct {
	RawAudio      []byte               // use RawAudio (for shared buffers) and sfx
	Buffer        audio.ReadSeekCloser // use Buffer for large files
	Panning       bool                 // use audio Panning feature
	StereoPanning bool
	PitchShift    bool
	Infinite      bool
	IntroLength   int64
	LoopLength    int64
}

type TrTween

type TrTween struct {
	Easing   easing.Function
	From     float64
	To       float64
	Duration float64
	Type     TrTweenType
}

type TrTweenTuple

type TrTweenTuple struct {
	Name  string
	Tween TrTween
}

type TrTweenType

type TrTweenType int
const (
	TrTweenX        TrTweenType = 1
	TrTweenY        TrTweenType = 2
	TrTweenRotation TrTweenType = 3
	TrTweenScaleXY  TrTweenType = 4
	TrTweenScaleX   TrTweenType = 5
	TrTweenScaleY   TrTweenType = 6
)

type TrTweening

type TrTweening struct {
	// contains filtered or unexported fields
}

func GetTrTweeningComponentData

func GetTrTweeningComponentData(w ecs.BaseWorld, e ecs.Entity) *TrTweening

GetTrTweeningComponentData gets the *TrTweening of Entity e

func NewTrTweening

func NewTrTweening() TrTweening

func (*TrTweening) Play

func (t *TrTweening) Play(name string) bool

func (*TrTweening) RemoveTween

func (t *TrTweening) RemoveTween(name string) bool

func (*TrTweening) SetDoneCallback

func (t *TrTweening) SetDoneCallback(fn func(name string)) *TrTweening

func (*TrTweening) SetTween

func (t *TrTweening) SetTween(name string, ttype TrTweenType, from, to, duration float64, easingfn easing.Function) *TrTweening

type TrTweeningComponent

type TrTweeningComponent struct {
	// contains filtered or unexported fields
}

TrTweeningComponent implements ecs.BaseComponent

func GetTrTweeningComponent

func GetTrTweeningComponent(w ecs.BaseWorld) *TrTweeningComponent

GetTrTweeningComponent returns the instance of the component in a World

func (*TrTweeningComponent) Data

func (c *TrTweeningComponent) Data(e ecs.Entity) *TrTweening

func (*TrTweeningComponent) Flag

func (c *TrTweeningComponent) Flag() ecs.Flag

Flag returns the

func (TrTweeningComponent) Name

func (TrTweeningComponent) Name() string

Name implements ecs.BaseComponent

func (*TrTweeningComponent) Remove

func (c *TrTweeningComponent) Remove(e ecs.Entity)

Remove a TrTweening data from entity e

Warning: DO NOT call remove inside the system entities loop

func (*TrTweeningComponent) Setup

func (c *TrTweeningComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)

Setup is called by ecs.BaseWorld

Do not call this directly

func (TrTweeningComponent) UUID

func (TrTweeningComponent) UUID() string

UUID implements ecs.BaseComponent

func (*TrTweeningComponent) Upsert

func (c *TrTweeningComponent) Upsert(e ecs.Entity, data interface{})

Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetTrTweeningComponentData to change component data outside of a system loop.

type TrTweeningSystem

type TrTweeningSystem struct {
	// contains filtered or unexported fields
}

TrTweeningSystem implements ecs.BaseSystem

func GetTrTweeningSystem

func GetTrTweeningSystem(w ecs.BaseWorld) *TrTweeningSystem

GetTrTweeningSystem returns the instance of the system in a World

func (*TrTweeningSystem) ComponentAdded

func (s *TrTweeningSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)

func (*TrTweeningSystem) ComponentRemoved

func (s *TrTweeningSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)

func (*TrTweeningSystem) ComponentResized

func (s *TrTweeningSystem) ComponentResized(cflag ecs.Flag)

func (*TrTweeningSystem) ComponentWillResize

func (s *TrTweeningSystem) ComponentWillResize(cflag ecs.Flag)

func (*TrTweeningSystem) Disable

func (s *TrTweeningSystem) Disable()

Disable system

func (*TrTweeningSystem) Draw

func (s *TrTweeningSystem) Draw(ctx core.DrawCtx)

Draw noop

func (*TrTweeningSystem) DrawPriority

func (s *TrTweeningSystem) DrawPriority(ctx core.DrawCtx)

DrawPriority noop

func (*TrTweeningSystem) Enable

func (s *TrTweeningSystem) Enable()

Enable system

func (*TrTweeningSystem) Enabled

func (s *TrTweeningSystem) Enabled() bool

Enabled checks if enabled

func (TrTweeningSystem) Name

func (TrTweeningSystem) Name() string

func (*TrTweeningSystem) Priority

func (*TrTweeningSystem) Priority() int64

func (*TrTweeningSystem) Setup

func (s *TrTweeningSystem) Setup(w ecs.BaseWorld)

func (TrTweeningSystem) UUID

func (TrTweeningSystem) UUID() string

UUID implements ecs.BaseSystem

func (*TrTweeningSystem) Update

func (s *TrTweeningSystem) Update(ctx core.UpdateCtx)

Update resolves active tweens

func (*TrTweeningSystem) UpdatePriority

func (s *TrTweeningSystem) UpdatePriority(ctx core.UpdateCtx)

UpdatePriority noop

func (*TrTweeningSystem) V

func (s *TrTweeningSystem) V() *viewTrTweeningSystem

type Transform

type Transform struct {
	// contains filtered or unexported fields
}

Transform is a hierarchy based matrix

func GetTransformComponentData

func GetTransformComponentData(w ecs.BaseWorld, e ecs.Entity) *Transform

GetTransformComponentData gets the *Transform of Entity e

func NewTransform

func NewTransform(x, y float64) Transform

func (*Transform) Angle

func (t *Transform) Angle() float64

Angle gets the angle (in radians)

func (*Transform) GeoM

func (t *Transform) GeoM() ebiten.GeoM

func (*Transform) Parent

func (t *Transform) Parent() ecs.Entity

func (*Transform) ParentTransform

func (t *Transform) ParentTransform() *Transform

func (*Transform) Pos

func (t *Transform) Pos() geom.Vec

func (*Transform) Scale

func (t *Transform) Scale() (sx, sy float64)

func (*Transform) ScaleX

func (t *Transform) ScaleX() float64

func (*Transform) ScaleY

func (t *Transform) ScaleY() float64

func (*Transform) SetAngle

func (t *Transform) SetAngle(r float64) *Transform

SetAngle sets the angle (in radians)

func (*Transform) SetParent

func (t *Transform) SetParent(e ecs.Entity) bool

func (*Transform) SetPos

func (t *Transform) SetPos(p geom.Vec) *Transform

func (*Transform) SetScale

func (t *Transform) SetScale(sx, sy float64) *Transform

func (*Transform) SetScaleX

func (t *Transform) SetScaleX(sx float64) *Transform

func (*Transform) SetScaleY

func (t *Transform) SetScaleY(sy float64) *Transform

func (*Transform) SetX

func (t *Transform) SetX(x float64) *Transform

func (*Transform) SetY

func (t *Transform) SetY(y float64) *Transform

func (*Transform) Tree

func (t *Transform) Tree() []*Transform

func (*Transform) X

func (t *Transform) X() float64

func (*Transform) Y

func (t *Transform) Y() float64

type TransformComponent

type TransformComponent struct {
	// contains filtered or unexported fields
}

TransformComponent implements ecs.BaseComponent

func GetTransformComponent

func GetTransformComponent(w ecs.BaseWorld) *TransformComponent

GetTransformComponent returns the instance of the component in a World

func (*TransformComponent) Data

func (c *TransformComponent) Data(e ecs.Entity) *Transform

func (*TransformComponent) Flag

func (c *TransformComponent) Flag() ecs.Flag

Flag returns the

func (TransformComponent) Name

func (TransformComponent) Name() string

Name implements ecs.BaseComponent

func (*TransformComponent) Remove

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

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

func (TransformComponent) UUID() string

UUID implements ecs.BaseComponent

func (*TransformComponent) Upsert

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

type TransformSystem struct {
	// contains filtered or unexported fields
}

TransformSystem implements ecs.BaseSystem

func GetTransformSystem

func GetTransformSystem(w ecs.BaseWorld) *TransformSystem

GetTransformSystem returns the instance of the system in a World

func (*TransformSystem) ComponentAdded

func (s *TransformSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)

func (*TransformSystem) ComponentRemoved

func (s *TransformSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)

func (*TransformSystem) ComponentResized

func (s *TransformSystem) ComponentResized(cflag ecs.Flag)

func (*TransformSystem) ComponentWillResize

func (s *TransformSystem) ComponentWillResize(cflag ecs.Flag)

func (*TransformSystem) Disable

func (s *TransformSystem) Disable()

Disable system

func (*TransformSystem) Draw

func (s *TransformSystem) Draw(ctx core.DrawCtx)

Draw noop

func (*TransformSystem) DrawPriority

func (s *TransformSystem) DrawPriority(ctx core.DrawCtx)

DrawPriority noop

func (*TransformSystem) Enable

func (s *TransformSystem) Enable()

Enable system

func (*TransformSystem) Enabled

func (s *TransformSystem) Enabled() bool

Enabled checks if enabled

func (*TransformSystem) GlobalToLocal

func (s *TransformSystem) GlobalToLocal(gx, gy float64, e ecs.Entity) (x, y float64, ok bool)

func (*TransformSystem) GlobalToLocalTr

func (s *TransformSystem) GlobalToLocalTr(gx, gy float64, tr *Transform) (x, y float64)

func (*TransformSystem) LocalToGlobal

func (s *TransformSystem) LocalToGlobal(lx, ly float64, e ecs.Entity) (x, y float64, ok bool)

func (*TransformSystem) LocalToGlobalTr

func (s *TransformSystem) LocalToGlobalTr(lx, ly float64, tr *Transform) (x, y float64)

func (TransformSystem) Name

func (TransformSystem) Name() string

func (*TransformSystem) Priority

func (*TransformSystem) Priority() int64

func (*TransformSystem) Setup

func (s *TransformSystem) Setup(w ecs.BaseWorld)

func (TransformSystem) UUID

func (TransformSystem) UUID() string

UUID implements ecs.BaseSystem

func (*TransformSystem) Update

func (s *TransformSystem) Update(ctx core.UpdateCtx)

Update calculates all transform matrices

func (*TransformSystem) UpdatePriority

func (s *TransformSystem) UpdatePriority(ctx core.UpdateCtx)

UpdatePriority noop

func (*TransformSystem) V

func (s *TransformSystem) V() *viewTransformSystem

type UpdateFn

type UpdateFn func(ctx core.UpdateCtx, e ecs.Entity)

type VICameraSystem

type VICameraSystem struct {
	Entity ecs.Entity

	Transform *Transform

	Camera *Camera
}

type VIFollowTransformSystem

type VIFollowTransformSystem struct {
	Entity ecs.Entity

	Transform *Transform

	FollowTransform *FollowTransform
}

type VIFunctionSystem

type VIFunctionSystem struct {
	Entity ecs.Entity

	Function *Function
}

type VITrTweeningSystem

type VITrTweeningSystem struct {
	Entity ecs.Entity

	Transform *Transform

	TrTweening *TrTweening
}

type VITransformSystem

type VITransformSystem struct {
	Entity ecs.Entity

	Transform *Transform
}

type WatchAudioPlayer

type WatchAudioPlayer interface {
	Entity() ecs.Entity
	Data() *AudioPlayer
}

WatchAudioPlayer is a helper struct to access a valid pointer of AudioPlayer

func WatchAudioPlayerComponentData

func WatchAudioPlayerComponentData(w ecs.BaseWorld, e ecs.Entity) WatchAudioPlayer

WatchAudioPlayerComponentData gets a pointer getter of an entity's AudioPlayer.

The pointer must not be stored because it may become invalid overtime.

type WatchCamera

type WatchCamera interface {
	Entity() ecs.Entity
	Data() *Camera
}

WatchCamera is a helper struct to access a valid pointer of Camera

func WatchCameraComponentData

func WatchCameraComponentData(w ecs.BaseWorld, e ecs.Entity) WatchCamera

WatchCameraComponentData gets a pointer getter of an entity's Camera.

The pointer must not be stored because it may become invalid overtime.

type WatchFollowTransform

type WatchFollowTransform interface {
	Entity() ecs.Entity
	Data() *FollowTransform
}

WatchFollowTransform is a helper struct to access a valid pointer of FollowTransform

func WatchFollowTransformComponentData

func WatchFollowTransformComponentData(w ecs.BaseWorld, e ecs.Entity) WatchFollowTransform

WatchFollowTransformComponentData gets a pointer getter of an entity's FollowTransform.

The pointer must not be stored because it may become invalid overtime.

type WatchFunction

type WatchFunction interface {
	Entity() ecs.Entity
	Data() *Function
}

WatchFunction is a helper struct to access a valid pointer of Function

func WatchFunctionComponentData

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 WatchTrTweening

type WatchTrTweening interface {
	Entity() ecs.Entity
	Data() *TrTweening
}

WatchTrTweening is a helper struct to access a valid pointer of TrTweening

func WatchTrTweeningComponentData

func WatchTrTweeningComponentData(w ecs.BaseWorld, e ecs.Entity) WatchTrTweening

WatchTrTweeningComponentData gets a pointer getter of an entity's TrTweening.

The pointer must not be stored because it may become invalid overtime.

type WatchTransform

type WatchTransform interface {
	Entity() ecs.Entity
	Data() *Transform
}

WatchTransform is a helper struct to access a valid pointer of Transform

func WatchTransformComponentData

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL