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

Method Draw

gui.go:2903–2940  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2901}
2902
2903func (row *ContainerRow) Draw() {
2904
2905 if row.AlternateBGColor {
2906
2907 if row.alternateBGColorFlag {
2908 globals.Renderer.SetDrawColor(getThemeColor(GUIMenuColor).RGBA())
2909 } else {
2910 globals.Renderer.SetDrawColor(getThemeColor(GUIMenuColor).Add(20).RGBA())
2911 }
2912
2913 if row.Container.WorldSpace {
2914 globals.Renderer.RenderFillRect(globals.Project.Camera.TranslateRect(row.rect))
2915 } else {
2916 globals.Renderer.RenderFillRect(row.rect)
2917 }
2918
2919 }
2920
2921 for _, element := range row.Elements {
2922 rect := element.Rectangle()
2923
2924 if rect.X+rect.H < row.Container.Rect.X || rect.Y+rect.H < row.Container.Rect.Y || rect.X >= row.Container.Rect.X+row.Container.Rect.W || rect.Y >= row.Container.Rect.Y+row.Container.Rect.H {
2925 continue
2926 }
2927
2928 element.Draw()
2929
2930 }
2931
2932 // if len(row.Tooltip) > 0 {
2933
2934 // if globals.Mouse.RawPosition().Inside(row.rect) {
2935 // DrawTooltip(Point{row.rect.X - 32, row.rect.Y - 32}, row.Tooltip)
2936 // }
2937
2938 // }
2939
2940}
2941
2942func (row *ContainerRow) FindElement(name string, wild bool) MenuElement {
2943

Callers

nothing calls this directly

Calls 6

getThemeColorFunction · 0.85
RGBAMethod · 0.80
TranslateRectMethod · 0.80
RectangleMethod · 0.65
DrawMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected