AJXB Posted April 7, 2014 Share Posted April 7, 2014 function onRender( ) local px, py = guiGetPosition ( pic,false ) local sx,sy = guiGetScreenSize () local nx, ny = interpolateBetween ( px, py,0,px,(py/3)+475,0,getProgress( 7500 ),"OutElastic",2,2,2) guiSetPosition( pic, nx, ny, false ) end addEventHandler( 'onClientRender', root, onRender ) I don't know what am I doing wrong, but this image, is only moving, not jumping and such.. if you know what I mean, OutElastic shouldn't be Linear NOTE: pic is created, getProgress function is added 2,2,2 is added because I don't really know what these numbers do e.e Link to comment
cheez3d Posted April 7, 2014 Share Posted April 7, 2014 local px,py = guiGetPosition(pic,false) local sx,sy = guiGetScreenSize() local function render_handler() local nx,ny = interpolateBetween(px,py,0,px,(py)/3+475,0,getProgress(7500),"OutElastic",2,2,2) guiSetPosition(pic,nx,ny,false) end addEventHandler("onClientRender",root,render_handler) Link to comment
AJXB Posted April 7, 2014 Author Share Posted April 7, 2014 local px,py = guiGetPosition(pic,false) local sx,sy = guiGetScreenSize() local function render_handler() local nx,ny = interpolateBetween(px,py,0,px,(py)/3+475,0,getProgress(7500),"OutElastic",2,2,2) guiSetPosition(pic,nx,ny,false) end addEventHandler("onClientRender",root,render_handler) well I don't really understand what you have changed, you did change this (py/3)+475 to (py)/3+475 and this caused wrong math Anyway, I guess you tried, appreciate it Link to comment
cheez3d Posted April 7, 2014 Share Posted April 7, 2014 I put the px,py,sx,sy variables outside onClientRender, otherwise you declare those variables every frame and the position of the picture will be different everytime. I tought you declared px and py as the start position of the animation. Link to comment
Moderators IIYAMA Posted April 7, 2014 Moderators Share Posted April 7, 2014 function onRender( ) local px, py = guiGetPosition ( pic,false ) local sx,sy = guiGetScreenSize () local nx, ny = interpolateBetween ( px, py,0,px,(py/3)+475,0,getProgress( 7500 ),"OutElastic",2,2,2) guiSetPosition( pic, nx, ny, false ) end addEventHandler( 'onClientRender', root, onRender ) I don't know what am I doing wrong, but this image, is only moving, not jumping and such.. if you know what I mean, OutElastic shouldn't be Linear NOTE: pic is created, getProgress function is added 2,2,2 is added because I don't really know what these numbers do e.e Easing functions like "Linear" and "OutElastic" do only affect the speed of moving. When you choose Linear, it will move with the same speed. When you choose InQuad, it will move fast in the beginning and slow down at the end. When you choose OutQuad, it will move slow in the beginning and speed up later. 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