Cyandie Posted May 27, 2012 Share Posted May 27, 2012 (edited) Okay so this is a short tutorial but I will show you how to get your GUI's screen resolution's first you should add something like this to your code local screenX, screenY = guiGetScreenSize() local width, height = 200, 450 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) the GUi Window would be like this SampleWindow = guiCreateWindow(x, y, width, height, "Hello World", false) Whe you have a gui window like this guiCreateWindow(15,125,129,17, "Hello World", false) you put the last two numbers at 'local width, height such as you put a new line in like this local width, height = 129, 17 and when you do something like guiCreateWindow(x, y, width, height, "Test Command", false) you'll get it working for all screen res's. Here is my Example Advanced Window GUI http://imgur.com/o7Dzd Edited May 30, 2012 by Guest Link to comment
X-SHADOW Posted May 30, 2012 Share Posted May 30, 2012 This is Nice [TUT] For Beginners Nice Man Keeb it going . Link to comment
Alpha Posted May 30, 2012 Share Posted May 30, 2012 screenX, screenY isn't defined, beginners wouldn't know what is it. Link to comment
Cyandie Posted May 30, 2012 Author Share Posted May 30, 2012 Updated - Fixed the 'local screenX, screenY = guiGetScreenSize()' Problem sorry I forgot about it but now it's there enjoy people. Link to comment
ASM Posted August 19, 2012 Share Posted August 19, 2012 What adanced is in this tutorial? Link to comment
toptional Posted August 19, 2012 Share Posted August 19, 2012 What adanced is in this tutorial? can you atleast thank him for helping? or do you have to criticize every scripting topic? Link to comment
Anderl Posted August 19, 2012 Share Posted August 19, 2012 What adanced is in this tutorial? can you atleast thank him for helping? or do you have to criticize every scripting topic? He is right, I don't see anything advanced here but still good job he did. Link to comment
Callum Posted August 20, 2012 Share Posted August 20, 2012 Should teach people not to use variables if they're only ever going to use them once. Link to comment
ASM Posted August 20, 2012 Share Posted August 20, 2012 Should teach people not to use variables if they're only ever going to use them once. I dont agree with you. It teachs how to make gui for every resolution. Link to comment
Anderl Posted August 20, 2012 Share Posted August 20, 2012 Should teach people not to use variables if they're only ever going to use them once. I dont agree with you. It teachs how to make gui for every resolution. Callum is right. It's not needed to use variables when you are going to use them one time only. Link to comment
ASM Posted August 21, 2012 Share Posted August 21, 2012 I wrote about tutorial, not - why we "Should teach people not to use variables if they're only ever going to use them once.". Also i will tell you what I think about your opinion because I totally dont agree with you. Why? Because variables are mutch clear. Example from my code: local speedometer = {} speedometer.active = false --MTA Fixer speedometer.fWidth = 512 speedometer.fHeight = 512 --Real speedometer.rWidth = 290 speedometer.rHeight = 289 speedometer.distFromScreen = 10 speedometer.x = screenX - speedometer.distFromScreen - speedometer.fWidth + ( speedometer.fWidth - speedometer.rWidth )/2 speedometer.y = screenY - speedometer.distFromScreen - speedometer.fHeight + ( speedometer.fHeight - speedometer.rHeight )/2 Next we just use: dxDrawImage(speedometer.x,speedometer.y,speedometer.fWidth,speedometer.fHeight,"images/speedometer/background.png", 0, 0, 0, tocolor(255, 255, 255, galpha), true) etc. Link to comment
Anderl Posted August 21, 2012 Share Posted August 21, 2012 I wrote about tutorial, not - why we "Should teach people not to use variables if they're only ever going to use them once.".Also i will tell you what I think about your opinion because I totally dont agree with you. Why? Because variables are mutch clear. Example from my code: local speedometer = {} speedometer.active = false --MTA Fixer speedometer.fWidth = 512 speedometer.fHeight = 512 --Real speedometer.rWidth = 290 speedometer.rHeight = 289 speedometer.distFromScreen = 10 speedometer.x = screenX - speedometer.distFromScreen - speedometer.fWidth + ( speedometer.fWidth - speedometer.rWidth )/2 speedometer.y = screenY - speedometer.distFromScreen - speedometer.fHeight + ( speedometer.fHeight - speedometer.rHeight )/2 Next we just use: dxDrawImage(speedometer.x,speedometer.y,speedometer.fWidth,speedometer.fHeight,"images/speedometer/background.png", 0, 0, 0, tocolor(255, 255, 255, galpha), true) etc. You didn't understand. Why will you save a variable in the memory which you will only use ONCE? It has nothing to do with being clear. Anyway, this is over. Link to comment
ASM Posted August 21, 2012 Share Posted August 21, 2012 Ok, If you wanna have chaos in your code - I dont care. Link to comment
Recommended Posts