Hi recently I try to create dxDrawRoundedRectangle where I can put text in it, it seems easy but dxGetTextWidth is scaling wrong. I use custom font
mojeW,mojeH = 1920,1080
sW,sH = guiGetScreenSize()
sx, sy = (sW/mojeW), (sH/mojeH)
local scale = 1
local minScale = 1.1
if sW < mojeW then
scale = math.min(minScale, mojeW/sW)
end
font = dxCreateFont("f.ttf", 13/scale)
local lol = "Wpisz tutaj coś..."
local width = dxGetTextWidth( lol:gsub("#%x%x%x%x%x%x", ""), sW*0.001, font )
dxDrawRoundedRectangle(24*sx, 271*sy, (width+5+5)*sx, 41*sy, 10, tocolor(35, 37, 62, 180), false)
dxDrawText(lol:gsub("#%x%x%x%x%x%x", ""), (29+1)*sx, (271+1)*sy, (29+1+480)*sx, (271+1+41)*sy, tocolor(0, 0, 0), 1, font, "left", "center", false, false, false, false)
dxDrawText(lol, 29*sx, 271*sy, (29+480)*sx, (271+41)*sy, tocolor(150, 150, 150, 255), 1, font, "left", "center", false, false, false, true)
link to view: https://imgur.com/a/WfJKimu
I can't figure it out, how to solve it. I want to make it look good on all resolutions.