addon

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFrameTime = 100 * time.Millisecond

Functions

This section is empty.

Types

type ActInfo added in v0.2.3

type ActInfo struct {
	FrameTime int `json:"frame_time"`
}

type AnimationAct added in v0.2.3

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

type AnimationFrame added in v0.2.3

type AnimationFrame struct {
	AnimationFrameSize `json:"frame"`
}

type AnimationFrameSize added in v0.2.3

type AnimationFrameSize struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
}

type AnimationInfo added in v0.2.3

type AnimationInfo struct {
	Frames map[string]AnimationFrame `json:"frames"`
	Acts   map[string]ActInfo        `json:"acts"`
}

func (*AnimationInfo) Regions added in v0.2.3

func (info *AnimationInfo) Regions(texture *suslik.Texture, prefix string) []*suslik.Region

type Animator added in v0.2.3

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

func MakeAnimator added in v0.2.3

func MakeAnimator(texture *suslik.Texture, info AnimationInfo) Animator

func (*Animator) Draw added in v0.2.3

func (animator *Animator) Draw(batch *suslik.Batch, name string, position, origin, scale suslik.Point, rot, alpha float32, color uint32)

func (*Animator) Play added in v0.2.3

func (animator *Animator) Play(name string, frame int)

func (*Animator) Playing added in v0.2.3

func (animator *Animator) Playing(name string) bool

func (*Animator) ResetTime added in v0.2.4

func (animator *Animator) ResetTime(name string)

func (*Animator) SetFrame added in v0.2.4

func (animator *Animator) SetFrame(name string, n int)

func (*Animator) SetFrameTime added in v0.2.3

func (animator *Animator) SetFrameTime(name string, dur time.Duration)

func (*Animator) SetFrameTimeAll added in v0.2.3

func (animator *Animator) SetFrameTimeAll(dur time.Duration)

func (*Animator) Stop added in v0.2.3

func (animator *Animator) Stop(name string)

type EventsBus

type EventsBus struct {
	suslik.Game
	// contains filtered or unexported fields
}

func NewEventsBus

func NewEventsBus() *EventsBus

func (*EventsBus) Events

func (bus *EventsBus) Events() []interface{}

func (*EventsBus) EventsImmediate

func (bus *EventsBus) EventsImmediate() []interface{}

func (*EventsBus) Reset

func (bus *EventsBus) Reset()

func (*EventsBus) Send

func (bus *EventsBus) Send(event interface{})

func (*EventsBus) Update

func (bus *EventsBus) Update(dt float32)

type Generic added in v0.3.0

type Generic interface {
	Update(parent *Object, dt float32)
	Render(parent *Object, batch *suslik.Batch)
	Close(parent *Object)

	UpdateChildren(parent *Object, dt float32)
	RenderChildren(parent *Object, batch *suslik.Batch)
	CloseChildren(parent *Object)

	Base() *Object
}

type Object added in v0.3.0

type Object struct {
	ID       uint
	ParentID uint
	Pos      suslik.Point
	Children []Generic
	Deleted  bool
}

func (*Object) Base added in v0.3.0

func (object *Object) Base() *Object

func (*Object) Close added in v0.3.0

func (object *Object) Close(parent *Object)

func (*Object) CloseChildren added in v0.3.0

func (object *Object) CloseChildren(parent *Object)

func (*Object) Render added in v0.3.0

func (object *Object) Render(parent *Object, batch *suslik.Batch)

func (*Object) RenderChildren added in v0.3.0

func (object *Object) RenderChildren(parent *Object, batch *suslik.Batch)

func (*Object) Update added in v0.3.0

func (object *Object) Update(parent *Object, dt float32)

func (*Object) UpdateChildren added in v0.3.0

func (object *Object) UpdateChildren(parent *Object, dt float32)

type ObjectConstructor added in v0.3.0

type ObjectConstructor func() interface{}

type ResponderStack

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

func NewResponderStack

func NewResponderStack(responder ...suslik.Responder) *ResponderStack

func (*ResponderStack) Close

func (rs *ResponderStack) Close()

func (*ResponderStack) Key

func (rs *ResponderStack) Key(key suslik.Key, modifier suslik.Modifier, action suslik.Action)

func (*ResponderStack) Mouse

func (rs *ResponderStack) Mouse(x, y float32, button suslik.Key, action suslik.Action)

func (*ResponderStack) Preload

func (rs *ResponderStack) Preload()

func (*ResponderStack) Render

func (rs *ResponderStack) Render()

func (*ResponderStack) Resize

func (rs *ResponderStack) Resize(width, height float32)

func (*ResponderStack) Scroll

func (rs *ResponderStack) Scroll(amount float32)

func (*ResponderStack) Setup

func (rs *ResponderStack) Setup()

func (*ResponderStack) Type

func (rs *ResponderStack) Type(char rune)

func (*ResponderStack) Update

func (rs *ResponderStack) Update(dt float32)

type Scene added in v0.3.0

type Scene struct {
	suslik.Game
	// contains filtered or unexported fields
}

func NewScene added in v0.3.0

func NewScene(world *World) *Scene

func (*Scene) Close added in v0.3.0

func (scene *Scene) Close()

func (*Scene) Preload added in v0.3.0

func (scene *Scene) Preload()

func (*Scene) Render added in v0.3.0

func (scene *Scene) Render()

func (*Scene) Resize added in v0.3.0

func (scene *Scene) Resize(w, h float32)

func (*Scene) Root added in v0.3.0

func (scene *Scene) Root() uint

func (*Scene) Setup added in v0.3.0

func (scene *Scene) Setup()

func (*Scene) Update added in v0.3.0

func (scene *Scene) Update(dt float32)

func (*Scene) World added in v0.3.0

func (scene *Scene) World() *World

type World added in v0.3.0

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

func NewWorld added in v0.3.0

func NewWorld() *World

func (*World) Build added in v0.3.0

func (world *World) Build(name string, parentID uint) (interface{}, bool)

func (*World) Delete added in v0.3.0

func (world *World) Delete(id uint)

func (*World) Move added in v0.3.0

func (world *World) Move(srcID, dstID uint)

func (*World) RegisterConstructor added in v0.3.0

func (world *World) RegisterConstructor(name string, constructor ObjectConstructor)

Jump to

Keyboard shortcuts

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