diff options
Diffstat (limited to 'objs/root.go')
| -rw-r--r-- | objs/root.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/objs/root.go b/objs/root.go new file mode 100644 index 0000000..59e0c6a --- /dev/null +++ b/objs/root.go @@ -0,0 +1,25 @@ +package objs + +import ( + "github.com/Zyko0/go-sdl3/sdl" + "ponger/ecs" +) + +type Root struct { + *ecs.GameObject +} + +func (root *Root) Render(r *sdl.Renderer) { + r.SetDrawColor(255, 255, 255, 255) + r.Clear() +} + +func NewRoot(children ...ecs.IsGameObject) ecs.IsGameObject { + r := &Root{ + GameObject: &ecs.GameObject{ + Position: sdl.FPoint{}, + Children: children, + }, + } + return r.GameObject +} |
