MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Draw

Method Draw

gui.go:3620–3640  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3618func (c *UIClock) Update() {}
3619
3620func (c *UIClock) Draw() {
3621
3622 rect := c.Rect
3623 if c.WorldSpace {
3624 rect = globals.Project.Camera.TranslateRect(rect)
3625 }
3626
3627 center := Vector{
3628 rect.X + (rect.W / 2),
3629 rect.Y + (rect.H / 2),
3630 }
3631
3632 radius := rect.W / 2
3633
3634 end := center.Add(Vector{0, -radius + 8}.Rotate(c.Rotation * math.Pi * 2))
3635
3636 FilledCircleColor(int32(rect.X+(rect.W/2)), int32(rect.Y+(rect.H/2)), int32(radius-4), c.EdgeColor)
3637 FilledCircleColor(int32(rect.X+(rect.W/2)), int32(rect.Y+(rect.H/2)), int32(radius-8), c.FillColor)
3638 ThickLine(center, end, 4, getThemeColor(GUIFontColor))
3639
3640}
3641
3642func (c *UIClock) Rectangle() *sdl.FRect {
3643 return c.Rect

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
FilledCircleColorFunction · 0.85
ThickLineFunction · 0.85
getThemeColorFunction · 0.85
TranslateRectMethod · 0.80
RotateMethod · 0.45

Tested by

no test coverage detected