I've see on the envy framework a lua file that has catch my attention
anim.lua
here there are some functs to move objetcs around the screen, with this demo i'm been trying to make it work, I'll add some more examples when I understand the how to function of all of them.
firs lineal moves..... next angular moves etc etc...
Using easing equations
Using easing equations
- Attachments
-
- moves.love
- (15.24 KiB) Downloaded 368 times
-
- Prole
- Posts: 5
- Joined: Thu Jun 11, 2009 2:26 am
Re: Using easing equations
This will be very helpful in my next project, but I can't get the source files. I rename the .love to .zip but WinRAR wouldn't extract it. Could you put the sources in a zip please, this will make alot of peoples games look awsome. Good work.
Re: Using easing equations
offcourse
there is the source and the second version of the program... all for you :-)
there is the source and the second version of the program... all for you :-)
- Attachments
-
- moves.zip
- (15.74 KiB) Downloaded 334 times
-
- moves2.love
- (15.4 KiB) Downloaded 329 times
-
- Prole
- Posts: 5
- Joined: Thu Jun 11, 2009 2:26 am
Re: Using easing equations
Oh yay! I Love you(pun intended)! I'm making an animation program, it's going to use tweening, and I wanted to have a easing option, letting the animator have more realistic movements in the final product. This is going to help me so much.
Re: Using easing equations
These functions are definitely helpful.
However I don't like how everything is based on strings.
So I edited anim.lua to be more class based.
However I don't like how everything is based on strings.
So I edited anim.lua to be more class based.
Code: Select all
function anim.create( from, to, time, delay, eq, ... )
function anim:start()
function anim:pause()
function anim:callback( delay, func, ... )
function anim:update()
function anim.updateAll()
function anim:get( default )
function anim:destination()
function anim:remove()
--example
buttonanim = anim.create( -200, 60, 0.5, 1, ANIM_QUAD_INOUT )
buttonanim:callback( 0.8, function() love.audio.play( menu.sound_whoosh ) end)
buttonanim:start()
Re: Using easing equations
arghhhhhhhhh superb!!!
please, can you make a example of this? and explain how the callback work?
please please :-)
It was the next step of the my code but you are the best
thanks thanks thanks ...
and thanks
EDIT: I haven't see the example sorry........ but perhaps you can add an example to the love file isn't?
please, can you make a example of this? and explain how the callback work?
please please :-)
It was the next step of the my code but you are the best
thanks thanks thanks ...
and thanks
EDIT: I haven't see the example sorry........ but perhaps you can add an example to the love file isn't?
Re: Using easing equations
Well I used the edited version in my parametric examples for the menu
http://love2d.org/forum/viewtopic.php?f=5&t=767
it's in menu.lua, but the code is a bit messy at the moment.
I might add an example to the moves lua, but it's not really that much different from the original.
Instead of remembering the string you just use the variable returned by anim.create()
http://love2d.org/forum/viewtopic.php?f=5&t=767
it's in menu.lua, but the code is a bit messy at the moment.
I might add an example to the moves lua, but it's not really that much different from the original.
Instead of remembering the string you just use the variable returned by anim.create()
Re: Using easing equations
Oh hey that's cool. When I originally wrote this I deliberately made them use strings so I didn't have to manually store the variables myself.ljdp wrote:These functions are definitely helpful.
However I don't like how everything is based on strings.
So I edited anim.lua to be more class based.
Code: Select all
function anim.create( from, to, time, delay, eq, ... ) function anim:start() function anim:pause() function anim:callback( delay, func, ... ) function anim:update() function anim.updateAll() function anim:get( default ) function anim:destination() function anim:remove() --example buttonanim = anim.create( -200, 60, 0.5, 1, ANIM_QUAD_INOUT ) buttonanim:callback( 0.8, function() love.audio.play( menu.sound_whoosh ) end) buttonanim:start()
Re: Using easing equations
I always prefer using a class based system because I would have ending up storing the strings to variables anyway so you end up using more space (although probably negligable). To each his own
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Using easing equations
I wonder which classes are used, as I see a lot of differences on these forums, I myself always use my own system (on the wiki, called SECS). There have been discussion about this on IRC, and we came to the conclusion we should all create (and use) libraries that conform to a certain syntax, to make them interchangeable (or at least, easier to switch).
Who is online
Users browsing this forum: No registered users and 0 guests