HUNGRY:3 Posted July 10, 2015 Share Posted July 10, 2015 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
GTX Posted July 10, 2015 Share Posted July 10, 2015 https://wiki.multitheftauto.com/wiki/Gu ... esolutions If you still don't know how to do that, show us the code. Link to comment
HUNGRY:3 Posted July 10, 2015 Author Share Posted July 10, 2015 (edited) https://wiki.multitheftauto.com/wiki/GuiGetScreenSize#Using_guiGetScreenSize_to_fit_GUI_.26_DX_drawing_in_all_resolutionsIf you still don't know how to do that, show us the code. I'm not pro thanks Edited July 11, 2015 by Guest Link to comment
Dealman Posted July 10, 2015 Share Posted July 10, 2015 ...If you were a "pro" you'd know how to make it fit for all resolutions, it's nothing but very basic math, really Link to comment
HUNGRY:3 Posted July 10, 2015 Author Share Posted July 10, 2015 ...If you were a "pro" you'd know how to make it fit for all resolutions, it's nothing but very basic math, really " " Link to comment
HUNGRY:3 Posted July 11, 2015 Author Share Posted July 11, 2015 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
Dealman Posted July 11, 2015 Share Posted July 11, 2015 Because you're using absolute values when you'll want to use relative values. I'd suggest you read this post I made before. Link to comment
KariiiM Posted July 11, 2015 Share Posted July 11, 2015 You've to use guiGetScreenSize Link to comment
HUNGRY:3 Posted July 11, 2015 Author Share Posted July 11, 2015 You've to use guiGetScreenSize i did Link to comment
GTX Posted July 11, 2015 Share Posted July 11, 2015 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
HUNGRY:3 Posted July 11, 2015 Author Share Posted July 11, 2015 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
GTX Posted July 11, 2015 Share Posted July 11, 2015 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
HUNGRY:3 Posted July 11, 2015 Author Share Posted July 11, 2015 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
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