Skip to content

Commit

Permalink
Spectator HUD: Increase fontsize (#3507)
Browse files Browse the repository at this point in the history
* spectator_hud: remove unused function

* spectator_hud: increase fontsize of knobs

Users with resolutions in the lower end such as 1080p have reported the
numbers on the knobs are small and hard to read. Increase the fontsize
by increasing both the height of the metric bars and the fontsize
itself.
  • Loading branch information
keelefi authored Jul 31, 2024
1 parent 79d5e69 commit b62f6df
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions luaui/Widgets/gui_spectator_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ local defaults = {
},

metricDimensions = {
height = 70,
height = 80,
-- width is same as widget width
},

Expand All @@ -175,7 +175,7 @@ local defaults = {
},

knobDimensions = {
fontSize = 32,
fontSize = 44,

cornerSize = 8,
outline = 4,
Expand Down Expand Up @@ -995,28 +995,6 @@ local function updateStats()
regenerateTextTextures = true
end

local function drawMetricKnobText(left, bottom, right, top, text)
-- note: call this function within a font:Begin() - font:End() block

local knobTextAreaWidth = right - left - 2 * knobDimensions.outline
local fontSizeSmaller = knobDimensions.fontSize
local textWidth = font:GetTextWidth(text)
while textWidth * fontSizeSmaller > knobTextAreaWidth do
fontSizeSmaller = fontSizeSmaller - 1
end

--font:Begin()
-- font:SetTextColor(textColorWhite)
font:Print(
text,
mathfloor((right + left) / 2),
mathfloor((top + bottom) / 2),
fontSizeSmaller,
'cvO'
)
--font:End()
end

local colorKnobMiddleGrey = { 0.5, 0.5, 0.5, 1 }
local function drawMetricBar(left, bottom, right, top, indexLeft, indexRight, metricIndex, mouseOver)
local valueLeft = teamStats[metricIndex].aggregates[indexLeft]
Expand Down

0 comments on commit b62f6df

Please sign in to comment.