-
Notifications
You must be signed in to change notification settings - Fork 5
/
debug.go
34 lines (27 loc) · 1.01 KB
/
debug.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
package RLBotGo
func (socket *RLBot) DebugMessageAdd(text string) error {
if socket.debugRenderGroup == nil {
socket.debugRenderGroup = &RenderGroup{Id: 1}
}
renderGroup := socket.debugRenderGroup
var message RenderMessage
message.Color = Color{A: 255, R: 46, G: 255, B: 0}
var start float32 = 20 * float32(len(renderGroup.RenderMessages))
message.Start = Vector3{X: 0, Y: start, Z: 0}
message.End = Vector3{X: 0, Y: start + 1, Z: 0}
message.ScaleX = 1
message.ScaleY = 1
message.IsFilled = true
message.RenderType = RenderType_DrawString2D
message.Text = text
renderGroup.RenderMessages = append(renderGroup.RenderMessages, message)
return socket.SendMessage(DataType_RenderGroup, socket.debugRenderGroup)
}
func (socket *RLBot) DebugMessageClear() error {
if socket.debugRenderGroup == nil {
socket.debugRenderGroup = &RenderGroup{Id: 1}
}
renderGroup := socket.debugRenderGroup
renderGroup.RenderMessages = []RenderMessage{}
return socket.SendMessage(DataType_RenderGroup, socket.debugRenderGroup)
}