Explicitly set minimap draw sizes
This commit is contained in:
parent
0f83298086
commit
575c9e0a18
|
@ -12,19 +12,29 @@ local MinimapOffsetX <const> = MinimapPosX + 5
|
|||
local MinimapMultY <const> = 0.70 * MinimapSizeY / C.FieldHeight
|
||||
local MinimapOffsetY <const> = MinimapPosY - 15
|
||||
|
||||
local RunnerSquareWidth = 8
|
||||
local FielderCircleRadius = 4
|
||||
local FielderCircleStrokeWidth = 2
|
||||
|
||||
function drawMinimap(runners, fielders)
|
||||
Minimap:draw(MinimapPosX, MinimapPosY)
|
||||
gfx.setColor(gfx.kColorBlack)
|
||||
for _, runner in pairs(runners) do
|
||||
local x = (MinimapMultX * runner.x) + MinimapOffsetX
|
||||
local y = (MinimapMultY * runner.y) + MinimapOffsetY
|
||||
gfx.fillRect(x, y, 8, 8)
|
||||
gfx.fillRect(x, y, RunnerSquareWidth, RunnerSquareWidth)
|
||||
end
|
||||
gfx.setLineWidth(FielderCircleStrokeWidth)
|
||||
for _, fielder in pairs(fielders) do
|
||||
local x = (MinimapMultX * fielder.x) + MinimapOffsetX
|
||||
local y = (MinimapMultY * fielder.y) + MinimapOffsetY
|
||||
if x > MinimapPosX and x < MinimapBoundX and y > MinimapPosY and y < MinimapBoundY then
|
||||
gfx.drawCircleAtPoint(x, y, 4)
|
||||
if
|
||||
x > MinimapPosX
|
||||
and x < MinimapBoundX
|
||||
and y > MinimapPosY
|
||||
and y < MinimapBoundY
|
||||
then
|
||||
gfx.drawCircleAtPoint(x, y, FielderCircleRadius)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue