animation

package
v0.0.0-...-21449c0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	FrameImages    []image.Image
	FrameTextures  []*rl.Texture2D
	FrameDurations []time.Duration
	CurrentFrame   int
	UntilNextFrame time.Duration
}

Animation is a component that contains multiple images+textures, as well as frame durations and the current frame index that is being displayed

func (*Animation) ExportToLua

func (component *Animation) ExportToLua(state *lua.LState, table *lua.LTable) *lua.LTable

ExportToLua exports the component into the given table, using the given lua state machine.

func (*Animation) New

func (*Animation) New() akara.Component

New creates a new animation component instance.

type Component

type Component = Animation // Component is an alias to Animation

type ComponentFactory

type ComponentFactory struct {
	*akara.ComponentFactory
}

ComponentFactory is a wrapper for the generic component factory that returns Component component instances.

func (*ComponentFactory) Add

func (concrete *ComponentFactory) Add(id akara.EID) *Component

Add adds a Component component to the given entity and returns it

func (*ComponentFactory) ExportToLua

func (concrete *ComponentFactory) ExportToLua(state *lua.LState, table *lua.LTable) *lua.LTable

func (*ComponentFactory) Get

func (concrete *ComponentFactory) Get(id akara.EID) (*Component, bool)

Get returns the Component component for the given entity, and a bool for whether or not it exists

Jump to

Keyboard shortcuts

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