Derma Scaling

I have made a very complex derma screen that I’m very happy about. The only problem is that it only looks how it’s suppose to look like in 1920X1080 res. Now I know it’s no easy fix for this. And I should have planned it out before I made the whole Derma Window. Does anyway have any idea on how I can make it look good on all screen resolutions?

Make the derma element’s size and position be set to a ratio of your screen width and screen height.

Use


ScrH()  

and


ScrW()

an example


blabla = vgui.create("DFrame")
blabla:SetPos(50, 50)
blabla:SetSize(ScrW() - 500, ScrH()- 500 )
blablab:SetTitle("Blabla")

ScrH = client screen height resolution
ScrW = client screen width resolution

[editline]19th September 2014[/editline]

fuck ninja’d

http://forum.facepunch.com/showthread.php?t=1417504

Using modifiers to have dynamic sizing of HUDs, panels, etc…
https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/understanding_hardcoding_of_screensizes.lua.html

Something else which may be useful… A PlayerChangedResolution Hook
https://dl.dropboxusercontent.com/u/26074909/tutoring/_hooks/acecool_hook_playerchangedresolution/gm_playerchangedresolution.lua

Example Usage ( this example shows how to set something up such as a poly table, and only recalculate the poly if the resolution changes / ie the hook gets called; this would work for vgui / panels too )
https://dl.dropboxusercontent.com/u/26074909/tutoring/_hooks/acecool_hook_playerchangedresolution/example_usage.lua