Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LuaExportInteractiveCallback ¶
func LuaExportInteractiveCallback(in *Interactive, state *lua.LState, table *lua.LTable)
Types ¶
type Component ¶
type Component = Interactive // Component is an alias to Interactive
type ComponentFactory ¶
type ComponentFactory struct {
*akara.ComponentFactory
}
ComponentFactory is a wrapper for the generic component factory.
func (*ComponentFactory) Add ¶
func (concrete *ComponentFactory) Add(id akara.EID) *Interactive
Add adds a Interactive component to the given entity and returns it
func (*ComponentFactory) ExportToLua ¶
ExportToLua exports the component into the given table, using the given lua state machine.
func (*ComponentFactory) Get ¶
func (concrete *ComponentFactory) Get(id akara.EID) (*Interactive, bool)
Get returns the Interactive component for the given entity, and a bool for whether or not it exists
type InputCallback ¶
type InputCallback = func() (preventPropogation bool)
type Interactive ¶
type Interactive struct { Enabled bool *vector.Vector Hitbox *image.Rectangle Callback InputCallback // TODO: better componentName for this? allows us to temporarily ignore this vector (for debouncing) UsedRecently bool // TODO: better componentName for this? disables the debouncing functionality so the input callback fires as fast as possible RapidFire bool }
Interactive is used to define an input state and a callback function to execute when that state is reached
func (*Interactive) ExportToLua ¶
ExportToLua exports the component into the given table, using the given lua state machine.
func (*Interactive) New ¶
func (*Interactive) New() akara.Component
New returns a Interactive component. By default, it contains a nil instance.
Click to show internal directories.
Click to hide internal directories.