FlyingSpoon Posted April 8, 2015 Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
WhoAmI Posted April 8, 2015 Share Posted April 8, 2015 You have to use interpolateBetween. You have nice examples on wiki. Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
WhoAmI Posted April 8, 2015 Share Posted April 8, 2015 Well, what do you want? Logo jumping all the time or only once? Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
WhoAmI Posted April 8, 2015 Share Posted April 8, 2015 startX, startY = 0, 0; -- starting position endX, endY = 300, 300; -- ending position t = 1; -- time addEventHandler ( "onClientReosurceStart", resourceRoot, function ( ) local startTime = getTickCount ( ); local duration = t * 1000; local render = function ( ) local elapsedTime = getTickCount ( ) - startTime; local progress = elapsedTime / duration; local x, y = interpolateBetween ( startX, startY, 0, endX, endY, 0, progress, "OutBounce" ); dxDrawImage ( x, y, 197, 105, "logo.png", 0, 0, 0, tocolor ( 255, 255, 255, 255 ), false ); end addEventHandler ( "onClientRender", root, render ); end ); Should work, didn't test. Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
WhoAmI Posted April 8, 2015 Share Posted April 8, 2015 dxDrawImage doesn't return an element. If you want to destroy it, you have to removeEventHandler ("onClientRender") from render function. Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 (edited) - Edited April 8, 2015 by Guest Link to comment
WhoAmI Posted April 8, 2015 Share Posted April 8, 2015 local render = function ( ) replace it to render = function ( ) Without 'local'. Link to comment
Tekken Posted April 8, 2015 Share Posted April 8, 2015 If you delete your codes then you don't deserve to be helped anymore..... Link to comment
Enargy, Posted April 8, 2015 Share Posted April 8, 2015 If you delete your codes then you don't deserve to be helped anymore..... +1 Link to comment
Tekken Posted April 8, 2015 Share Posted April 8, 2015 Why Beacause you come here for help and if someone need help we can send him directly to this post and he can solve the problem faster. That's why! Link to comment
FlyingSpoon Posted April 8, 2015 Author Share Posted April 8, 2015 Forgive me, I wont do that next time, I know it can help someone else, I forgot. 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