summaryrefslogtreecommitdiff
path: root/engine/UI/GridRow.go
blob: bb9ffe31a6a2abe9aed592dfaacdd383485ae5df (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 ui

import rl "github.com/gen2brain/raylib-go/raylib"

type GridRow struct {
	// A portion of the screen the row will occupy. Works similar to CSS's 'flex-grow'
	HeightWeight float32
	// The objects that lay in this row
	Objects []UIElement

	location rl.Rectangle
}

func (base *GridRow) Init(parent *Menu) {
	for _, v := range base.Objects {
		v.Init(parent)
	}
}

func (base *GridRow) Draw(span rl.Rectangle) {
	// TODO: Add horizontal spacing
	for _, v := range base.Objects {
		v.Draw(&span)
	}
}