nxr045

Untitled

Oct 16th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.68 KB | None | 0 0
  1. GUIEditor = {
  2.     checkbox = {},
  3.     window = {},
  4.     button = {}
  5. }
  6.  
  7.  
  8.  
  9. addEventHandler("onClientResourceStart", resourceRoot,
  10.     function()
  11.         local sW, sH = guiGetScreenSize()
  12.         --local sx, sy = sW/640, sH/480
  13.         --local sx, sy = sW/1024, sH/768
  14.         --local x, y = 455/sW, 344/sH
  15.      
  16.         --GUIEditor.window[1] = guiCreateWindow(sW/2-481/2, sH/2-412/2, 481, 412, "", false)
  17.         --local thing1 = sW*(359/1024)
  18.         --outputChatBox(tostring(thing1))
  19.         GUIEditor.window[1] = guiCreateWindow(sW*(359/1024), sH*(245/768), sW*(347/1024), sH*(255/768), "", false)
  20.        
  21.         --GUIEditor.window[1] = guiCreateWindow(320, 448, 320, 320, "", false)
  22.         --GUIEditor.window[1] = guiCreateWindow(233, 100, 481, 412, "", false)
  23.         --guiSetProperty( GUIEditor.window[1], "VerticalAlignment", "Centre" )
  24.         --guiSetProperty( GUIEditor.window[1], "HorizontalAlignment", "Centre" )
  25.         --GUIEditor.window[1] = guiCreateWindow(sW/2-481/2, sH/2-412/2, 481, 412, "", false)
  26.         guiWindowSetMovable(GUIEditor.window[1], true)
  27.         --GUIEditor.button[1] = guiCreateButton(64, 61, 102, 46, "", false, GUIEditor.window[1])
  28.         --GUIEditor.button[1] = guiCreateButton(20, 40, 102, 46, "", false, GUIEditor.window[1])
  29.         --GUIEditor.button[1] = guiCreateButton(20, 20, sx*50, sy*50, "", false, GUIEditor.window[1])
  30.         --guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
  31.         GUIEditor.checkbox[1] = guiCreateCheckBox(86, 162, 15, 15, "", false, false, GUIEditor.window[1])
  32.        
  33.         --guiSetProperty( GUIEditor.window[1], "VerticalAlignment", "Centre" )
  34.         --guiSetProperty( GUIEditor.window[1], "HorizontalAlignment", "Centre" )
  35.  
  36.         --outputChatBox(sx..", "..sy)
  37.        
  38.     end
  39. )
  40.  
  41. addCommandHandler("s",
  42.     function(cmd, num)
  43.         local sW, sH = guiGetScreenSize()
  44.         if (cmd == "s") then
  45.             if (num == "1") then
  46.                 if (not GUIEditor.window[1]) then
  47.                     local sx, sy = sW/1024, sH/768
  48.                     GUIEditor.window[1] = guiCreateWindow(200, 344, sx*100, sy*100, "", false)
  49.                     centerWindow(GUIEditor.window[1])
  50.                 elseif (GUIEditor.window[1]) then
  51.                     destroyElement(GUIEditor.window[1])
  52.                     GUIEditor.window[1] = nil
  53.                 end
  54.             end
  55.             if (num == "2") then
  56.                 if (not GUIEditor.window[1]) then
  57.                     local sx, sy = sW/640, sH/480
  58.                     GUIEditor.window[1] = guiCreateWindow(200, 344, sx*100, sy*100, "", false)
  59.                     centerWindow(GUIEditor.window[1])
  60.  
  61.                 elseif (GUIEditor.window[1]) then
  62.                     destroyElement(GUIEditor.window[1])
  63.                     GUIEditor.window[1] = nil
  64.                 end
  65.             end
  66.             if (num == "3") then
  67.                 local x, y = guiGetPosition(GUIEditor.window[1], false)
  68.                 local w, h = guiGetSize(GUIEditor.window[1], false)
  69.                 outputChatBox(x..", "..y..", "..w..", ".. h)
  70.             end
  71.         end
  72.     end
  73. )
Advertisement
Add Comment
Please, Sign In to add comment