-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.go
60 lines (52 loc) · 1.43 KB
/
types.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
package main
type InstructionType int
const (
String InstructionType = iota
Polygon
Rectangle
Circle
)
type Instruction struct {
Type InstructionType `json:"type"`
Data interface{} `json:"data"`
}
type RenderQueue struct {
Instructions []Instruction `json:"instructions"`
}
type StringInstruction struct {
X int `json:"x"`
Y int `json:"y"`
Text string `json:"text"`
Color int `json:"color"`
Alpha float32 `json:"alpha"`
Stroke bool `json:"stroke"`
StrokeColor int `json:"strokeColor"`
StrokeThickness int `json:"strokeThickness"`
}
type PolygonInstruction struct {
Path []int `json:"path"`
Color int `json:"color"`
Alpha float32 `json:"alpha"`
Fill bool `json:"fill"`
Thickness int `json:"thickness"`
}
type RectangleInstruction struct {
X1 int `json:"x1"`
Y1 int `json:"y1"`
X2 int `json:"x2"`
Y2 int `json:"y2"`
Color int `json:"color"`
Alpha float32 `json:"alpha"`
Fill bool `json:"fill"`
Thickness int `json:"thickness"`
Radius int `json:"radius"`
}
type CircleInstruction struct {
X int `json:"x"`
Y int `json:"y"`
Radius int `json:"radius"`
Color int `json:"color"`
Alpha float32 `json:"alpha"`
Fill bool `json:"fill"`
Thickness int `json:"thickness"`
}