dugasz1 Posted December 14, 2016 Share Posted December 14, 2016 Hello guys. So, I'm working on a HUD and i want it to look good for every size of monitor. The size of the recentagles and the images is just easly declared relativly to the screen width or height (It's ok it's looks good on FullHD and 1377x768) My biggest problem is the fonts. I want it to be easily readable for everyone but to achieve that i should now the ppi or somethink like that. Is there any way to get it (ppi or diameter)? Any suggestion how should i do this if i can get those data? Link to comment
coNolel Posted December 14, 2016 Share Posted December 14, 2016 DxGetTextWidth DxGetTextFontHeight ? Link to comment
dugasz1 Posted December 14, 2016 Author Share Posted December 14, 2016 I know these function but i don't know why do you linked them. What should i do with them. Link to comment
pa3ck Posted December 14, 2016 Share Posted December 14, 2016 PPI has nothing to do with relative sizing, PPI or Pixel Per Inch is a completely different thing. Look at this image: Low PPI vs High PPI Assuming you can get the PPI with an MTA function (which I don't think is possible), what would you change on the screens with low PPI? Whatever you do, it will look bad. Link to comment
dugasz1 Posted December 14, 2016 Author Share Posted December 14, 2016 (edited) I want relativly sizing it for the monitor's resolution and diameter (or somehow in a real life unit) As far as i know PPI stands for Pixel Per Inch. And with real life unit (cm,inch etc) i can make sure that people will see that writing. Pixels aren't good because it depends on the PPI how big (in cm,inch) will be the font. (For example i want my fonts around 1cm height) Or any tip would be great how can i solve this. I tried scalling it (use my monitor as a base) local screenX, screenY = guiGetScreenSize() local scallingFactor = (screenX*screenY)/(1920*1080) But it looks shi*ty. If it looks good on FullHD then it's unreadable on 1377x768. If it ok on 1377x768 then it's too big on FullHD. Edited December 14, 2016 by dugasz1 Link to comment
pa3ck Posted December 14, 2016 Share Posted December 14, 2016 You still don't understand what PPI is. Let's say I have a :~ty monitor which is 1600x900 with 20 PPI and my buddy got a 1600x900 with 40 PPI, the size of the monitor is still the same, he will see exactly the same thing as me. You probably think the PPI gives you the "real life unit" of the screen, but only the resolution matters. I can have a huge screen with 640*480... Look at this image -> Link to comment
dugasz1 Posted December 15, 2016 Author Share Posted December 15, 2016 I can calculate real life unit (cm,inch etc.) from PPI Let's say i have a 40px height font: If i have 10PPI display it means i have a 40/10*2,54 cm height which is ~= 10,16 cm height font. If i have 20PPI display it means i have 40/20*2,54 cm height which is ~= 5,08 cm height font. So, they won't see the same thing because on the lower PPI the font will be twice as high as on 20PPI. (Sorry if i can explain what i'm talking about and what i want to achive but not my native languge) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now