summaryrefslogtreecommitdiff
path: root/objs/root.go
blob: 649200df2e12a7dee23210ba2b3f9a22cb4d367e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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(0, 0, 0, 255)
	r.Clear()
}

func NewRoot(children ...ecs.IsGameObject) ecs.IsGameObject {
	r := &Root{
		GameObject: &ecs.GameObject{
			Position: sdl.FPoint{},
			Children: children,
		},
	}
	return r
}