Effect Radar Implementation v1 #46

Merged
hersi merged 12 commits from feature/radar into master 2023-11-23 07:41:15 +01:00
1 changed files with 12 additions and 5 deletions
Showing only changes of commit e9d848d92f - Show all commits

View File

@ -1078,23 +1078,30 @@ end
---This function is basically a workaround for the ForceRender call
local function drawRadar()
gfx.FontSize(28)
gfx.Translate(500, 500)
local x, y = 375, 650
local scale = 0.666
local strokeColor = ColorRGBA.new(255, 255, 255, 255)
gfx.FontSize(28)
gfx.Translate(x, y)
gfx.Scale(scale, scale)
local strokeColor = ColorRGBA.new(255, 255, 255, 128)
local fillColor = ColorRGBA.new(0, 0, 0, 191)
gfx.ResetScissor()
radar:drawBackground(fillColor)
radar:drawOutline(3, strokeColor)
--NOTE: Bug: forcerender resets every transformation, need to re-setup view transform afterwards
--Bug: ForceRender resets every transformation, need to re-setup view transform afterwards
--ForceRender also resets gfx stack, USC will crash if you try to call gfx.Restore(),
--make sure the gfx stack is clean before calling radar:drawRadarMesh()
radar:drawRadarMesh()
Dim.transformToScreenSpace()
gfx.Save()
gfx.Translate(500,500)
gfx.Translate(x, y)
gfx.Scale(scale, scale)
radar:drawRadialTicks(strokeColor)
radar:drawAttributes()
gfx.Restore()