Page 2 of 2
Re: Fling: a library
Posted: Mon Sep 14, 2009 9:50 pm
by paclito
Superb work but...... you can ?
All of the examples i have see at this forum are like this code
Code: Select all
love.filesystem.require("somelib.lua")
function load()
-- Something to load game
end
function update( dt )
-- the update code
end
function draw()
-- the draw code
end
can you post one example that is like this and of course continue in the develop of this library... perhaps add easing and some functional examples with some help lines :-)
thanks!
Re: Fling: a library
Posted: Mon Sep 14, 2009 10:03 pm
by Robin
The following is the example from my .love, in a more traditional form, ie not using the default hooks:
Code: Select all
require "fling.lua"
function load()
img1 = fling.image('sun.png', .5, .5)
fling.translate(img1, 40, 40, 5,
function () fling.translate(img1, .9, 40, 3,
function () fling.translate(img1, .9, .9, 7,
function () fling.tween(img1, 0.01, .999, 'inquad', 3) end
) end
) end
)
fling.scale(img1, 7, 5, 6)
fling.rotate(img1, 180, 20)
fling.delay.scale(img1, -1, -1, 10, 1)
end
function update(dt)
fling.update(dt)
end
function draw()
fling.draw()
end
function keypressed(key)
fling.translate(img1, .5, .5, 2)
end
And as for developing it further: I'm a bit stuck. If people who know how to implement easing and know flash could help me, that would be great.
Re: Fling: a library
Posted: Tue Sep 15, 2009 5:52 am
by paclito
ok, this is best... thanks, thanks and thanks
now i understand the code. for the easing code, there is an library on the envy framework called anim.lua.
this library works for me.... callback... some easing types and some examples on the forum.