Jump to content

Screen Size


Stevor

Recommended Posts

hello guys

i created draw design it's XD and i use guieditor to create it

but when i use guieditor i select in element ( Relative ) to be same scale in all screen's

 

but right now i have problem in size

 

here is an example of my screen, or similar screens ( This is the look I see and want for everyone )

 

https://prnt.sc/103qjru

 

here example for other size screen ( here the shape is not suitable for the original design )

 

https://prnt.sc/103qspv

 

How do I solve the problem (even if I have to change the design scheme)

Edited by Stevor
Link to post
21 hours ago, Tekken said:

Here an very good tutorial: 

:)

Thank you i see it now

Does this mean that I will

By manually measuring the size of each screen ?

 

how to do with this


 

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
        dxDrawRectangle(screenW * 0.2787, screenH * 0.2767, screenW * 0.0675, screenH * 0.1189, tocolor(255, 255, 255, 255), false)
        dxDrawText("Text Here", screenW * 0.2787, screenH * 0.2767, screenW * 0.3463, screenH * 0.3956, tocolor(0, 0, 0, 255), 1.56, "default-bold", "center", "center", false, false, false, false, false)
    end
)

 

Edited by Stevor
Link to post

For text to be good positioned I use this:

local screenW, screenH = guiGetScreenSize()
resW = screenW/1600 --(put your resolution here instead of 1600)
resH = screenH/900 --(put your resolution here instead of 900)

function a()
dxDrawText("asd", screenW * 0.2000, screenH * 0.3000, screenW * 0.0350, screenH * 0.0350, tocolor(255, 255, 255, 255), 1.00*resW, "bankgothic", "left", "top", false, false, false, false)
end

-- I put *resW on the text scale

 

Link to post
3 hours ago, Hydra said:

For text to be good positioned I use this:



local screenW, screenH = guiGetScreenSize()
resW = screenW/1600 --(put your resolution here instead of 1600)
resH = screenH/900 --(put your resolution here instead of 900)

function a()
dxDrawText("asd", screenW * 0.2000, screenH * 0.3000, screenW * 0.0350, screenH * 0.0350, tocolor(255, 255, 255, 255), 1.00*resW, "bankgothic", "left", "top", false, false, false, false)
end

-- I put *resW on the text scale

 

thx it's work

can i do same thing with 

dxDrawRectangle

to be in same Size and Place ?

Edited by Stevor
Link to post
24 minutes ago, Hydra said:

Yes it's possible to do that with rectangle too

dxDrawRectangle(screenW * 0.2787, screenH * 0.2767, screenW * 0.0675, screenH * 0.1189, tocolor(255, 255, 255, 255), false)

this is the Rectangle

where i can set resW 

Link to post
On 24/02/2021 at 22:15, Hydra said:

mostly at x and y

dxDrawRectangle(resW * 0.2787, resH * 0.2767, screenW * 0.0675, screenH * 0.1189, tocolor(255, 255, 255, 255), false)

like this ?

Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...