iPrestege Posted January 16, 2013 Share Posted January 16, 2013 hi , i create 2 images using guieditor! the problem the Screen size!i create it on the center!but the problem!Different from computer to computer!So how can I make it on the center just like the center window! Link to comment
Castillo Posted January 16, 2013 Share Posted January 16, 2013 You should create the GUI on relative positions, not absolute. You can also center it with this function: https://wiki.multitheftauto.com/wiki/CenterWindow Link to comment
iPrestege Posted January 16, 2013 Author Share Posted January 16, 2013 You should create the GUI on relative positions, not absolute.You can also center it with this function: https://wiki.multitheftauto.com/wiki/CenterWindow 1-Yes, I did that!But did not succeed! 2-Yes I try that! But the images come on top of each other! Here my problem! Is there a solution? Link to comment
Castillo Posted January 16, 2013 Share Posted January 16, 2013 Then you don't want both on center, because one will stay over the other. Link to comment
iPrestege Posted January 16, 2013 Author Share Posted January 16, 2013 I want that! But different screen size! I want that and strongly! Link to comment
iPrestege Posted January 16, 2013 Author Share Posted January 16, 2013 My Code: g_ResRoot = getResourceRootElement(getThisResource()) GUIEditor = { label = {}, staticimage = {}, } fadeCamera(false) showChat(false) showCursor(true) function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end GUIEditor.label[1] = guiCreateLabel(234, 30, 877, 72, "Welcome To Gta Pro Server (=", false) guiLabelSetColor(GUIEditor.label[1], 221, 254, 0) GUIEditor.label[2] = guiCreateLabel(157, 556, 1124, 100, "Chose Your Best Game And Have Fun!", false) guiLabelSetColor(GUIEditor.label[2], 221, 254, 0) Drift = guiCreateStaticImage(263, 157, 423, 348, "1.png", false) centerWindow(Drift) --------------------------------------- War = guiCreateStaticImage(706, 157, 423, 348, "2.png", false) centerWindow(War) Link to comment
Castillo Posted January 16, 2013 Share Posted January 16, 2013 Try this: GUIEditor = { label = {}, staticimage = {}, } fadeCamera(false) showChat(false) showCursor(true) GUIEditor.label[1] = guiCreateLabel(234, 30, 877, 72, "Welcome To Gta Pro Server (=", false) guiLabelSetColor(GUIEditor.label[1], 221, 254, 0) GUIEditor.label[2] = guiCreateLabel(157, 556, 1124, 100, "Chose Your Best Game And Have Fun!", false) guiLabelSetColor(GUIEditor.label[2], 221, 254, 0) Drift = guiCreateStaticImage(0.08, 0.20, 0.41, 0.45, "1.png", true) --------------------------------------- War = guiCreateStaticImage(0.51, 0.20, 0.41, 0.45, "2.png", true) Link to comment
iPrestege Posted January 17, 2013 Author Share Posted January 17, 2013 Try this: GUIEditor = { label = {}, staticimage = {}, } fadeCamera(false) showChat(false) showCursor(true) GUIEditor.label[1] = guiCreateLabel(234, 30, 877, 72, "Welcome To Gta Pro Server (=", false) guiLabelSetColor(GUIEditor.label[1], 221, 254, 0) GUIEditor.label[2] = guiCreateLabel(157, 556, 1124, 100, "Chose Your Best Game And Have Fun!", false) guiLabelSetColor(GUIEditor.label[2], 221, 254, 0) Drift = guiCreateStaticImage(0.08, 0.20, 0.41, 0.45, "1.png", true) --------------------------------------- War = guiCreateStaticImage(0.51, 0.20, 0.41, 0.45, "2.png", true) Now works correctly! But how can I do it here too?: Grove = guiCreateStaticImage(223, 169, 244, 333, "Grove.png", false) Police = guiCreateStaticImage(592, 169, 244, 333, "Police.png", false) eam = guiCreateStaticImage(912, 169, 244, 333, "NoTeam.png", false) Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 You must convert these positions to relative as I said on my first reply, that's what I did with the other images. I used guieditor to load the images, then change them to relative, output them and done. Link to comment
iPrestege Posted January 17, 2013 Author Share Posted January 17, 2013 (edited) You must convert these positions to relative as I said on my first reply, that's what I did with the other images.I used guieditor to load the images, then change them to relative, output them and done. Did you convert it to the center? i use loadcode when i paste the code say : loaded successfully but now what? i cant find it! Edited January 17, 2013 by Guest Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 No, I actually re-created the images one at each side of the screen. Link to comment
iPrestege Posted January 17, 2013 Author Share Posted January 17, 2013 No, I actually re-created the images one at each side of the screen. i recreate the images and i got this: GUIEditor.staticimage[1] = guiCreateStaticImage(264, 165, 171, 401, "Grove.png", false) GUIEditor.staticimage[2] = guiCreateStaticImage(621, 165, 171, 401, "Police.png", false) GUIEditor.staticimage[3] = guiCreateStaticImage(959, 165, 171, 401, "NoTeam.png", false) Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 They are still absolute. Link to comment
iPrestege Posted January 17, 2013 Author Share Posted January 17, 2013 They are still absolute. Now? Grove = guiCreateStaticImage(0.16325037181377,0.22005207836628,0.17862372100353,0.43359375,"Grove.png", true) Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 That seems to be relative. Though, the new guieditor outputs it in 3 digits maximum. Link to comment
iPrestege Posted January 17, 2013 Author Share Posted January 17, 2013 That seems to be relative.Though, the new guieditor outputs it in 3 digits maximum. My friend has programming! Script help me to get the pos relative! using : guiGetPosition guiGetSize Thank You For Help! 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