Jump to content

animation problem


Dice

Recommended Posts

when maximize is clicked...

setTimer ( function() 
                local x, y = guiGetSize ( win, false ) 
                if y <= 537 then 
                    guiSetSize ( win, x, y + 0.04, false ) 
                end 
            end, 50, 0 ) 

the code literally does nothing.

would onClientRender do the trick?

Link to comment

Try this:

function doAnimation ( ) 
    local x, y = guiGetSize ( win, false ) 
    if ( y <= 537 ) then 
        guiSetSize ( win, x, y + 0.04, false ) 
    else 
        removeEventHandler ( "onClientRender", root, doAnimation ) 
    end 
end 
addEventHandler ( "onClientRender", root, doAnimation ) 

Link to comment

Ofc the "code literally does nothing" .

You are using Y+0.04 with absolute system that mean very very litel. And with that timmer you will need 1.2 secound only to grow it 1px.

@xXMADEXx 's code it's better bk it's faster but still +0.04 very low , with 60fps you will need +/- 0.25 s to move it 1 px so you will move it 4px/s

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