func (e MouseEvent) Channel() string {
	return "mouse"
}
Channel of MouseEvent = "mouse"
package tge
import (
	fmt "fmt"
	reflect "reflect"
	time "time"
)
var _runtimeInstance Runtime
type Runtime interface {
	GetAsset(path string) ([]byte, error)
	GetHost() interface{}
	GetRenderer() interface{}
	GetSettings() Settings
	Subscribe(channel string, listener Listener)
	Unsubscribe(channel string, listener Listener)
	Publish(event Event)
	Stop()
}
type Listener func(event Event) bool
type App interface {
	OnCreate(settings *Settings) error
	OnStart(runtime Runtime) error
	OnResume()
	OnRender(elaspedTime time.Duration, syncChan <-chan interface{})
	OnTick(elaspedTime time.Duration, syncChan chan<- interface{})
	OnPause()
	OnStop()
	OnDispose()
}
type Plugin interface {
	Init(runtime Runtime) error
	GetName() string
	Dispose()
}
var plugins = make(map[string]Plugin)
func Register(plugin Plugin) {
	name := plugin.GetName()
	if _, found := plugins[name]; !found {
		plugins[name] = plugin
		fmt.Printf("Plugin %s registered\n", name)
	}
}
func initPlugins() {
	for _, plugin := range plugins {
		err := plugin.Init(_runtimeInstance)
		if err != nil {
			fmt.Printf("Failed to initialize plugin %s: %v\n", plugin.GetName(), err)
			panic(err)
		}
		fmt.Printf("Plugin %s loaded\n", plugin.GetName())
	}
}
func dispose() {
	for _, plugin := range plugins {
		plugin.Dispose()
		fmt.Printf("Plugin %s released\n", plugin.GetName())
	}
}
type Type byte
type Button byte
type KeyCode int
const (
	ButtonNone Button = 0x00
	ButtonLeft Button = 0x01
	ButtonRight Button = 0x02
	ButtonMiddle Button = 0x04
	TouchFirst Button = 0x10
	TouchSecond Button = 0x20
	TouchThird Button = 0x40
	ButtonLeftOrTouchFirst Button = 0x11
)
func (b Button) String() string {
	switch b {
	case ButtonNone:
		return "ButtonNone"
	case ButtonLeft:
		return "ButtonLeft"
	case ButtonRight:
		return "ButtonRight"
	case ButtonMiddle:
		return "ButtonMiddle"
	case TouchFirst:
		return "TouchFirst"
	case TouchSecond:
		return "TouchSecond"
	case TouchThird:
		return "TouchThird"
	}
	return "unknown"
}
const (
	TypeNone Type = 0x00
	TypeDown Type = 0x01
	TypeUp Type = 0x02
	TypeMove Type = 0x04
)
func (t Type) String() string {
	switch t {
	case TypeNone:
		return "TypeNone"
	case TypeDown:
		return "TypeDown"
	case TypeUp:
		return "TypeUp"
	case TypeMove:
		return "TypeMove"
	}
	return "unknown"
}
type Event interface {
	Channel() string
}
type ResizeEvent struct {
	Width, Height int32
}
func (e ResizeEvent) Channel() string {
	return "resize"
}
type MouseEvent struct {
	X, Y   int32
	Button Button
	Type   Type
}