Jump to content

Moving Gui


K4stic

Recommended Posts

-- Gui sizes = 266, 450 
function closePanel() 
    local x, y = guiGetSize ( window, false ) 
    if ( y - 15 ) > 0 then 
        guiSetSize( window, x, y - 15, false ) 
    else 
        guiSetSize( window, x, 0, false) 
        guiSetVisible ( window, false) 
        removeEventHandler ( "onClientPreRender", root, closePanel ) 
    end 
end 
  
function openPanelPrepair() 
    addEventHandler( "onClientPreRender", root, openPanel ) 
end 

That stuck at 4th line don't know why :/ [ No eny Errors in Debugscript 3 ]

Link to comment

Try this:

-- Gui sizes = 266, 450 
function closePanel() 
    local wX, wY = guiGetSize ( window, false ) 
    local y = wY - 15 
    if (y > 0) then 
        guiSetSize( window, wX, y, false ) 
    else 
        guiSetSize( window, wX, 0, false) 
        guiSetVisible ( window, false) 
        removeEventHandler ( "onClientPreRender", root, closePanel ) 
    end 
end 
  
function openPanelPrepair() 
    addEventHandler( "onClientPreRender", root, openPanel ) 
end 

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