Jump to content

guigetscreensize


Recommended Posts

hi , can anyone help me with guigetscreensize here? i want it available for all resolutions

GUIEditor = { 
    button = {}, 
    window = {} 
} 
        local x, y = guiGetScreenSize(); 
        GUIEditor.window[1] = guiCreateWindow(359, 224, 312, 252, "Medic 1.0 - ZP", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1], false) 
        GUIEditor.button[1] = guiCreateButton(102, 55, 110, 57, "Medical Treatment\n500$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(102, 165, 110, 58, "Close", false, GUIEditor.window[1]) 

Link to comment
hi , can anyone help me with guigetscreensize here? i want it available for all resolutions
GUIEditor = { 
    button = {}, 
    window = {} 
} 
        local x, y = guiGetScreenSize(); 
        GUIEditor.window[1] = guiCreateWindow(359, 224, 312, 252, "Medic 1.0 - ZP", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1], false) 
        GUIEditor.button[1] = guiCreateButton(102, 55, 110, 57, "Medical Treatment\n500$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(102, 165, 110, 58, "Close", false, GUIEditor.window[1]) 

Use the X and Y in the first 4 arguments to set the position of the elements.

Example: x*0.3, y*0.5, x*0,6, y*0.5

Link to comment

use this function

  
-- Plz set this first 
local currentResolutionX = 800--Your Resolution X the one wich in it u made the window 
local currentResolutionY = 600 --Your resolution Y  the one wich in it u made the window 
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
        local x, y = guiGetScreenSize(); 
        GUIEditor.window[1] = guiCreateWindow(currentResolutionX(359), currentResolutionY(224), currentResolutionX (312), currentResolutionY(252), "Medic 1.0 - ZP", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1], false) 
        GUIEditor.button[1] = guiCreateButton(102, 55, 110, 57, "Medical Treatment\n500$", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(102, 165, 110, 58, "Close", false, GUIEditor.window[1]) 
  
function correctResolutinY(y) 
    if y then 
        return (y/600)*h 
    end 
end 
  
function correctResolutinX(x) 
    if x then 
        return (x/800)*w 
    end 
end 
  

please dont forget to change the cyrrentResoltuion x and y to the resolution which using it u create the GUI

this function I mean correctResolutionX and Y will work with DX too

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