-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
78 lines (56 loc) · 1.1 KB
/
interfaces.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package zgui
import (
"fmt"
rl "github.com/xzebra/raylib-go/raylib"
)
type IDrawable interface {
Draw()
}
type IUpdateable interface {
Update(dt float32)
}
type IPosition interface {
GetX() float32
GetY() float32
}
type IContainer interface {
IPosition
GetWidth() float32
GetHeight() float32
}
type IConstraint interface {
IContainer
setParent(IConstraints)
self() IConstraints
parent() IConstraints
move(d float32)
SetRelativeValue(val float32)
}
type IConstraints interface {
IContainer
setParent(IConstraints)
getParent() IConstraints
SetX(IConstraint)
SetY(IConstraint)
SetWidth(IConstraint)
SetHeight(IConstraint)
GetXConstraint() IConstraint
GetYConstraint() IConstraint
GetHeightConstraint() IConstraint
GetWidthConstraint() IConstraint
GetBounds() rl.Rectangle
GetParentBounds() rl.Rectangle
move(dx, dy float32)
}
type IComponent interface {
IDrawable
IUpdateable
IConstraints
fmt.Stringer
setConstraints(IConstraints)
GetConstraints() IConstraints
GetState() GuiState
Add(IComponent, IConstraints)
TouchInBounds() bool
MouseInBounds(mx int32, my int32) bool
}