How would I ScreenSize text properly?

Everytime I try too ScreenSize my text to support all resolution only my hud supports it not the text i’ve used ScrW, ScrH and ScreenScale. They seem to not scale my text properly

Snippet of Code
[LUA]
draw.SimpleText( “30”, “DermaLarge”, ScreenScale( 178 ), ScreenScale( 338 ), Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER)
[/LUA]

Jetboom came up with a few different functions which may work better…


// Jetboom
function BetterScreenScale( size )
	return size * math.max(0.5, ScrH( ) / 1200)
end

// Jetboom 2
function BetterScreenScale2( size )
    return size * math.Clamp(ScrH( ) / 1080, 0.6, 1)
end

And this one I have no idea where it came from:


function ScaleToWideScreen(size)
	return math.min(math.max( ScreenScale(size / 2.62467192), math.min(size, 14) ), size);
end;

Hopefully they help.

ScreenScale convert weight to client window size. For example: ScreenScale(1024) - 512
If you wanna convert height, use custom vars. Val = ScrH() * 0.08 and etc, and use this value for drawing. But you need check all screen types: 4:3; 16:9; 16:10.