mirror of
https://github.com/felixangell/phi.git
synced 2024-10-26 17:18:31 +03:00
21 lines
333 B
Go
21 lines
333 B
Go
package gui
|
|
|
|
import (
|
|
"github.com/felixangell/strife"
|
|
"github.com/veandco/go-sdl2/sdl"
|
|
)
|
|
|
|
type InputHandler struct {
|
|
Event sdl.Event
|
|
}
|
|
|
|
func HandleEvent(comp Component, evt strife.StrifeEvent) {
|
|
comp.HandleEvent(evt)
|
|
for _, child := range comp.GetComponents() {
|
|
if child == nil {
|
|
continue
|
|
}
|
|
child.HandleEvent(evt)
|
|
}
|
|
}
|