summaryrefslogtreecommitdiff
path: root/objs/root.go
blob: 59e0c6ad9a4040899e3adbfc55cc3633f562c346 (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(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
}