-
Notifications
You must be signed in to change notification settings - Fork 2
/
drawopts.go
59 lines (45 loc) · 1.53 KB
/
drawopts.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
package examples
import (
. "github.com/jakecoffman/cp/v2"
)
type DrawOptions struct {
flags uint
outline, constraint, collisionPoint FColor
data interface{}
}
func NewDrawOptions(flags uint, outline, constraint, collisionPoint FColor, data interface{}) *DrawOptions {
return &DrawOptions{flags, outline, constraint, collisionPoint, data}
}
func (*DrawOptions) DrawCircle(pos Vector, angle, radius float64, outline, fill FColor, data interface{}) {
DrawCircle(pos, angle, radius, outline, fill)
}
func (*DrawOptions) DrawSegment(a, b Vector, fill FColor, data interface{}) {
DrawSegment(a, b, fill)
}
func (*DrawOptions) DrawFatSegment(a, b Vector, radius float64, outline, fill FColor, data interface{}) {
DrawFatSegment(a, b, radius, outline, fill)
}
func (*DrawOptions) DrawPolygon(count int, verts []Vector, radius float64, outline, fill FColor, data interface{}) {
DrawPolygon(count, verts, radius, outline, fill)
}
func (*DrawOptions) DrawDot(size float64, pos Vector, fill FColor, data interface{}) {
DrawDot(size, pos, fill)
}
func (d *DrawOptions) Flags() uint {
return d.flags
}
func (d *DrawOptions) OutlineColor() FColor {
return d.outline
}
func (*DrawOptions) ShapeColor(shape *Shape, data interface{}) FColor {
return ColorForShape(shape, data)
}
func (d *DrawOptions) ConstraintColor() FColor {
return d.constraint
}
func (d *DrawOptions) CollisionPointColor() FColor {
return d.collisionPoint
}
func (d *DrawOptions) Data() interface{} {
return d.data
}