I’m trying to draw a rectangle on the screen, I just worked out that the x, y, width and height needs to be a percentage between 0.0-1.0, but when I try to draw a rectangle at the moment, it doesn’t position properly at all. Below is the code I’m currently using to display it.
local ScrW, ScrH = GetScreenResolution()
local widthOfWindow, heightOfWindow = 750, 550
local w, h = (widthOfWindow / 1.5) / ScrW, (heightOfWindow / 1.5) / ScrH
local x, y = ((ScrW / 2) - (widthOfWindow / 2)) / ScrW, ((ScrH / 1.5) - (heightOfWindow / 1.5)) / ScrH
DrawRect( x, y, w, h, 0, 0, 0, 200 )
In theory, this code should make a window that’s evenly sized on the left and right, then place it centered in the screen, but it doesn’t, it’s off the screen, any help?