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.





an example

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

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

[editline]19th September 2014[/editline]

fuck ninja’d

Using modifiers to have dynamic sizing of HUDs, panels, etc…

Something else which may be useful… A PlayerChangedResolution Hook

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 )