blob: 44309ac560398307bfefff709866391187022a27 (
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
26
27
28
29
|
package objs
import (
"github.com/Zyko0/go-sdl3/sdl"
"ponger/ecs"
)
type Root struct {
*ecs.GameObject
Height, Width int32
}
func (root *Root) Render(r *sdl.Renderer) {
r.SetDrawColor(0, 0, 0, 255)
r.Clear()
}
func NewRoot(window *sdl.Window, children ...ecs.IsGameObject) ecs.IsGameObject {
x, y, _ := window.Size()
r := &Root{
GameObject: &ecs.GameObject{
Position: sdl.FPoint{},
Children: children,
},
Width: x,
Height: y,
}
return r
}
|