| 782 | var indices []int32 |
| 783 | |
| 784 | func ThickLine(start, end Vector, thickness float32, color Color) { |
| 785 | |
| 786 | th := thickness |
| 787 | |
| 788 | diagStart1 := start.Sub(end).Unit().Rotate(math.Pi / 4).Scale(th) |
| 789 | diagStart2 := start.Sub(end).Unit().Rotate(-math.Pi / 4).Scale(th) |
| 790 | |
| 791 | diagEnd1 := end.Sub(start).Unit().Rotate(math.Pi / 4).Scale(th) |
| 792 | diagEnd2 := end.Sub(start).Unit().Rotate(-math.Pi / 4).Scale(th) |
| 793 | |
| 794 | vertices = append(vertices[:0], |
| 795 | sdl.Vertex{ |
| 796 | Position: sdl.FPoint{ |
| 797 | start.X + diagStart1.X, |
| 798 | start.Y + diagStart1.Y, |
| 799 | }, |
| 800 | Color: color.SDLFColor(), |
| 801 | }, |
| 802 | |
| 803 | sdl.Vertex{ |
| 804 | Position: sdl.FPoint{ |
| 805 | start.X + diagStart2.X, |
| 806 | start.Y + diagStart2.Y, |
| 807 | }, |
| 808 | Color: color.SDLFColor(), |
| 809 | }, |
| 810 | |
| 811 | sdl.Vertex{ |
| 812 | Position: sdl.FPoint{ |
| 813 | end.X + diagEnd1.X, |
| 814 | end.Y + diagEnd1.Y, |
| 815 | }, |
| 816 | Color: color.SDLFColor(), |
| 817 | }, |
| 818 | |
| 819 | sdl.Vertex{ |
| 820 | Position: sdl.FPoint{ |
| 821 | end.X + diagEnd2.X, |
| 822 | end.Y + diagEnd2.Y, |
| 823 | }, |
| 824 | Color: color.SDLFColor(), |
| 825 | }, |
| 826 | ) |
| 827 | |
| 828 | indices = append(indices[:0], |
| 829 | 0, 1, 3, |
| 830 | 1, 2, 3, |
| 831 | ) |
| 832 | |
| 833 | globals.Renderer.RenderGeometry(globals.PlainWhiteTexture, vertices, indices) |
| 834 | |
| 835 | } |
| 836 | |
| 837 | func FilledCircleColor(x, y, radius int32, color Color) { |
| 838 | |