tweening

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Pliskin09
Citizen
Posts: 89
Joined: Fri Jul 24, 2009 8:30 am

tweening

Post by Pliskin09 »

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 .
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: tweening

Post by Robin »

I had an idea for a library for love to do things like that: Fling (or FLash INspired Graphics). Haven't done anything for it yet.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: tweening

Post by bartbes »

Seems like something that can be easily done from a user-created library. (in pure lua)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: tweening

Post by Robin »

bartbes wrote:Seems like something that can be easily done from a user-created library. (in pure lua)
== Fling
Help us help you: attach a .love.
User avatar
TechnoCat
Inner party member
Posts: 1612
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: tweening

Post by TechnoCat »

Robin wrote:
bartbes wrote:Seems like something that can be easily done from a user-created library. (in pure lua)
== Fling
Fling: a library Robin's thread.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests