Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 18/09/23 in all areas

  1. Moved to the Spanish support section for best results.
    1 point
  2. Hello to whoever is reading this topic, today I've decided to take some time and explain in (personally) easiest possible way how to make a drawing or a GUI that will fit all resolutions, no matter if it's 1280x1024 or 640x480. Here are the following steps: Let's say you're using 1280x1024 resolution. You have the following function: dxDrawText("$10000000", 990, 200, 1100, 250, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") Take out the positionings from the function: 990, 200, 1100, 250 Divide 1280 with X positions (990, 1100) separately. You'll get 1280/990=1.292929 and 1280/1100=1.16363 Do the same with Y positions, but use 1024 as that is maximum height (aka Y of the screen). You'll get 1024/200=5.12 and 1024/250=4.096 The numbers you got are the scales that will work in every resolution as they work in your resolution (1280x1024). To use those scales, simply divide the clients' resolution with the scale, for example: screenWidth, screenHeight = guiGetScreenSize() dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") That's it! There's an extra scaling you can do for text size, which is tricky to work with (due to text getting blurred, ugly and unreadable) but if you're up for it: screenWidth, screenHeight = guiGetScreenSize() scale = (screenWidth/1280)*(screenHeight/1024) -- this will give you a number that will vary around 1, depending on clients' resolution (if resolution is smaller, scale will be below 1, if higher then above 1) dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), scale*1, "pricedown") -- as you can see I multiplied the text size (1) with the scale, which means the text will be bigger or smaller (again, depending on the clients' screen resolution) Hope I helped, please provide some feedback for future references!
    1 point
×
×
  • Create New...