()
| 3306 | func (image *GUIImage) Update() {} |
| 3307 | |
| 3308 | func (image *GUIImage) Draw() { |
| 3309 | |
| 3310 | if !image.Visible { |
| 3311 | return |
| 3312 | } |
| 3313 | |
| 3314 | if image.TintByFontColor { |
| 3315 | color := getThemeColor(GUIFontColor) |
| 3316 | image.Texture.SetColorMod(color.RGB()) |
| 3317 | image.Texture.SetAlphaMod(color[3]) |
| 3318 | } else { |
| 3319 | image.Texture.SetColorMod(255, 255, 255) |
| 3320 | image.Texture.SetAlphaMod(255) |
| 3321 | } |
| 3322 | |
| 3323 | rect := image.Rect |
| 3324 | |
| 3325 | if image.WorldSpace { |
| 3326 | rect = globals.Project.Camera.TranslateRect(rect) |
| 3327 | } |
| 3328 | |
| 3329 | globals.Renderer.RenderTexture(image.Texture, image.SrcRect, rect) |
| 3330 | |
| 3331 | if image.Border { |
| 3332 | globals.Renderer.SetDrawColor(getThemeColor(GUIFontColor).RGBA()) |
| 3333 | globals.Renderer.RenderRect(rect) |
| 3334 | } |
| 3335 | |
| 3336 | if globals.DebugMode == DebugModeUI { |
| 3337 | dst := &sdl.FRect{image.Rect.X, image.Rect.Y, image.Rect.W, image.Rect.H} |
| 3338 | if image.WorldSpace { |
| 3339 | dst = globals.Project.Camera.TranslateRect(dst) |
| 3340 | } |
| 3341 | |
| 3342 | globals.Renderer.SetDrawColor(255, 0, 255, 255) |
| 3343 | globals.Renderer.RenderFillRect(dst) |
| 3344 | } |
| 3345 | |
| 3346 | } |
| 3347 | func (image *GUIImage) Rectangle() *sdl.FRect { |
| 3348 | return &sdl.FRect{image.Rect.X, image.Rect.Y, image.Rect.W, image.Rect.H} |
| 3349 | } |
nothing calls this directly
no test coverage detected