tweening
Posted: Sat Aug 15, 2009 5:08 pm
i think the abillity to set 2 values for a single property (image alpha, x position, y position etc) and have the engine tween those 2 together and run it would be usefull. for example
tween = love.something.tween(0,30,5)
ball:setX(tween)
the tween would continue to loop from 0 to 30 every 5 seconds (so -> 6, 12, 18, 24, 30 and repeat). leaving it like that would make the ball move right from 0 to 30 over and over again. in the balls update step, we could check the status of the tween and do stuff accordingly.
if tween:status == "loopend" then...etc
i havnt thought it out very well but i just wanted to put the idea out there. i see its main uses in gui's and background effects. other uses could be for platforms in 2d games for example. since the tween would simply return a number, it isnt restricted to only altering the x and y of an object as well. you could combine it with anything that requires a number as a parameter.
anywho, tell me your ideas.
edit:
technocats video is a good example of how it could be used for a menu. see how most of the "buttons" move about? on the main menu for example, clicking on "music" hides everything else and smoothly animates the text from its current possition to the very top, increasing its size at the same time. you could achieve this with 3 tweens - ones for size, x coords and y coords .
tween = love.something.tween(0,30,5)
ball:setX(tween)
the tween would continue to loop from 0 to 30 every 5 seconds (so -> 6, 12, 18, 24, 30 and repeat). leaving it like that would make the ball move right from 0 to 30 over and over again. in the balls update step, we could check the status of the tween and do stuff accordingly.
if tween:status == "loopend" then...etc
i havnt thought it out very well but i just wanted to put the idea out there. i see its main uses in gui's and background effects. other uses could be for platforms in 2d games for example. since the tween would simply return a number, it isnt restricted to only altering the x and y of an object as well. you could combine it with anything that requires a number as a parameter.
anywho, tell me your ideas.
edit:
technocats video is a good example of how it could be used for a menu. see how most of the "buttons" move about? on the main menu for example, clicking on "music" hides everything else and smoothly animates the text from its current possition to the very top, increasing its size at the same time. you could achieve this with 3 tweens - ones for size, x coords and y coords .