longsnake34 Posted January 31, 2017 Share Posted January 31, 2017 (edited) Hi dude how are you ? My problem is screen resolution for example(1360x and 1690x or 2960x) and how to make all screen resolutions ? Edited January 31, 2017 by longsnake34 Link to comment
Bonsai Posted January 31, 2017 Share Posted January 31, 2017 Try to use the search. You will find tons of posts about the same problem. And somewhere you will find some good answers. Link to comment
longsnake34 Posted January 31, 2017 Author Share Posted January 31, 2017 (edited) @BonsaiI couldn't find it can you give example to all screen resolutions ? but 800x600 screen resolution is problem Edited January 31, 2017 by longsnake34 Link to comment
iPrestege Posted January 31, 2017 Share Posted January 31, 2017 You can see the wiki page about dx resolution for all screens from here : guiGetScreenSize There's an example there try to do it. Link to comment
longsnake34 Posted January 31, 2017 Author Share Posted January 31, 2017 (edited) @iPrestege Would problem in Resolution? (1360x, 800x600, 2960x, 640x) local sx, sy = guiGetScreenSize( ) addEventHandler( "onClientRender", root, function( ) dxDrawText( "Resolution example", sx*( 684/1024 ), sy*( 731/768 ), sx*( 732/1024 ), sy( 766/768 ), tocolor(0,255,255,175), sx/1000*1.0,"bankgothic","left","top",false,false,false ) end ) Edited January 31, 2017 by longsnake34 Link to comment
marty000123 Posted January 31, 2017 Share Posted January 31, 2017 1 hour ago, longsnake34 said: @BonsaiI couldn't find it can you give example to all screen resolutions ? but 800x600 screen resolution is problem Who the :O still has that screen resolution anyway? 1 Link to comment
longsnake34 Posted January 31, 2017 Author Share Posted January 31, 2017 (edited) I don't know I need your help 800x600 Image 1 1360x768 Image 2 Edited January 31, 2017 by longsnake34 Link to comment
Jayceon Posted January 31, 2017 Share Posted January 31, 2017 local screenX, screenY = guiGetScreenSize() local responsiveMultiplier = (screenX + 2048) / (2048 * 2) local testRectangleWidth = 256 * responsiveMultiplier local testRectangleHeight = 128 * responsiveMultiplier local testFont = dxCreateFont("fontPath.ttf", 14 * responsiveMultiplier, false, "antialiased") local marginOffset = 10 local rightSideOfTheScreen = (screenX - marginOffset) - testRectangleWidth local centerTheBoxY = (screenY - testRectangleHeight) / 2 dxDrawRectangle(rightSideOfTheScreen, centerTheBoxY, testRectangleWidth, testRectangleHeight, tocolor(0, 0, 0, 150)) -- on dxDrawText scale is 1.0 or smaller when you have custom font, responsiveMultiplier only using it in dxCreateFont Link to comment
longsnake34 Posted January 31, 2017 Author Share Posted January 31, 2017 (edited) Thank you brothers it's working, Solved the topic. Edited January 31, 2017 by longsnake34 Link to comment
longsnake34 Posted January 31, 2017 Author Share Posted January 31, 2017 (edited) how to move text to red zone ? Image local screenX, screenY = guiGetScreenSize() local responsiveMultiplier = (screenX + 2048) / (2048 * 2) local testRectangleWidth = 350 * responsiveMultiplier local testRectangleHeight = 225 * responsiveMultiplier local testFont = dxCreateFont("font.ttf", 14 * responsiveMultiplier, false, "antialiased") local marginOffset = 10 local rightSideOfTheScreen = (screenX - marginOffset) - testRectangleWidth local centerTheBoxY = (screenY - testRectangleHeight) / 2 function render() dxDrawRectangle(rightSideOfTheScreen, centerTheBoxY, testRectangleWidth, testRectangleHeight, tocolor(0, 0, 0, 150)) for i = 1, 5 do dxDrawText ( ""..i..". GridList DX",rightSideOfTheScreen, centerTheBoxY+50*i, testRectangleWidth, testRectangleHeight, tocolor ( 255, 255, 255, 255 ), 0.8,testFont,"center","center",true,true,true,true,false) end end addEventHandler("onClientRender", root, render) Edited January 31, 2017 by longsnake34 Link to comment
longsnake34 Posted February 1, 2017 Author Share Posted February 1, 2017 (edited) solved the topic, please close to my topic. Edited February 1, 2017 by longsnake34 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