Jump to content

[HELP]screen resolution


HUNGRY:3

Recommended Posts

Hello guys i have a problem...

I have created a help panel with img... it's working good with 1600x500 screen resolution

But when I change it to 860x420 or 1024 it's not showing the the hole img it's just showing a little part of it how to fix it?

Link to comment

okay idk why it's not working :/

i want it to work for all the resolutions

CNRPANEL = { 
    button = {}, 
    staticimage = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        local sWidth,sHeight = guiGetScreenSize() 
        CNRPANEL.staticimage[1] = guiCreateStaticImage(0, 0, sWidth,sHeight, "imgs/background.png", false) 
        guiSetVisible(CNRPANEL.staticimage[1],false) 
         
  
        CNRPANEL.staticimage[2] = guiCreateStaticImage(0, 0, 1024, 31, "imgs/tab.png", false, CNRPANEL.staticimage[1]) 
  
        CNRPANEL.label[1] = guiCreateLabel(709,5, 278, 16, "CvR - Cops Vs Robs", false, CNRPANEL.staticimage[2]) 
        guiSetFont(CNRPANEL.label[1], "default-bold-small") 
        guiLabelSetColor(CNRPANEL.label[1], 255, 2, 2) 
        guiLabelSetHorizontalAlign(CNRPANEL.label[1], "center", false) 
  
        CNRPANEL.button[1] = guiCreateButton(10, 41, 372, 310, "Cop", false, CNRPANEL.staticimage[1]) 
        local font0_EmblemaOne = guiCreateFont("fonts/EmblemaOne.ttf", 50) 
        guiSetFont(CNRPANEL.button[1], font0_EmblemaOne) 
        guiSetProperty(CNRPANEL.button[1], "NormalTextColour", "FF051CFB") 
        guiSetAlpha(CNRPANEL.button[1], 0.30)  
        CNRPANEL.button[2] = guiCreateButton(1298, 730, 372, 310, "Rob", false, CNRPANEL.staticimage[1]) 
        guiSetFont(CNRPANEL.button[2], font0_EmblemaOne) 
        guiSetProperty(CNRPANEL.button[2], "NormalTextColour", "FFFF0000") 
        guiSetAlpha(CNRPANEL.button[2], 0.30)  
        CNRPANEL.label[2] = guiCreateLabel(392, 488, 929, 103, "Choose Your Team!", false, CNRPANEL.staticimage[1]) 
        local font1_EmblemaOne = guiCreateFont("fonts/EmblemaOne.ttf", 60) 
        guiSetFont(CNRPANEL.label[2], font1_EmblemaOne) 
        guiLabelSetColor(CNRPANEL.label[2], 255, 0, 0)     
    end 
) 
  

Link to comment

I gave you the link, why don't you use it?

CNRPANEL.staticimage[2] = guiCreateStaticImage(0, 0, sWidth, sHeight*0.04036458333, "imgs/tab.png", false, CNRPANEL.staticimage[1]) 

Assuming you're using 1024x768.

Link to comment
I gave you the link, why don't you use it?
CNRPANEL.staticimage[2] = guiCreateStaticImage(0, 0, sWidth, sHeight*0.04036458333, "imgs/tab.png", false, CNRPANEL.staticimage[1]) 

Assuming you're using 1024x768.

The image is showing for all the resloution it's okay but the button and the label idk how to do it.

Link to comment
CNRPANEL.button[1] = guiCreateButton(10, 41, 372, 310, "Cop", false, CNRPANEL.staticimage[1]) 

10, 41, 372, 310

10/1024 = 0.009765625

41/768 = 0.05338541666

372/1024 = 0.36328125

310/768 = 0.40364583333

Numbers in red represent YOUR resolution, where GUI perfectly fits on screen.

CNRPANEL.button[1] = guiCreateButton(sWidth*0.009765625, sHeight*0.05338541666, sWidth*0.36328125, sHeight*0.40364583333, "Cop", false, CNRPANEL.staticimage[1]) 

You can also use relative values (between 0 and 1), but then change 6th argument to true.

Link to comment
CNRPANEL.button[1] = guiCreateButton(10, 41, 372, 310, "Cop", false, CNRPANEL.staticimage[1]) 

10, 41, 372, 310

10/1024 = 0.009765625

41/768 = 0.05338541666

372/1024 = 0.36328125

310/768 = 0.40364583333

Numbers in red represent YOUR resolution, where GUI perfectly fits on screen.

CNRPANEL.button[1] = guiCreateButton(sWidth*0.009765625, sHeight*0.05338541666, sWidth*0.36328125, sHeight*0.40364583333, "Cop", false, CNRPANEL.staticimage[1]) 

You can also use relative values (between 0 and 1), but then change 6th argument to true.

Oh lol now I got it thanks!

Link to comment

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...