Page 1 of 2

Animating Effects/Transitions

Posted: Wed Sep 09, 2009 11:29 pm
by Angrycrow
I know that LOVE supports GIF/Sprite batch techniques for animation.

Before I go off and do it myself are there any tween/ fade libraries that are written with love or are compatible?

For example. If I'm making a button/image fade in and out. or flash shift over when the mouse is hovering.

I feel like there is already a better solution for simple shift over/shift back animation.

I know it's not part of CORE GAME DESIGN ( which I'd love to talk about), But aesthetically what ways does LOVE support graphic design? Visual feedback as part of game design.

Re: Animating Effects/Transitions

Posted: Thu Sep 10, 2009 12:52 am
by Jasoco
I wouldn't mind one either. Fading down and up. I've usually built my own in other languages. But am having trouble doing it in LÖVE.

I just need to get one for transitioning between maps. So I don't need some complex thing. I even use my own camera system rather than overloading my code with a separate framework.

Also, animations have been removed from the next version.

Re: Animating Effects/Transitions

Posted: Thu Sep 10, 2009 3:10 pm
by Robin
I have started Fling, which is a library to do flash-like things in LÖVE, however it is hugely unfinished. But if you or anyone have something for Fling, you can just add it, since it belongs to the community.

Re: Animating Effects/Transitions

Posted: Sat Sep 12, 2009 10:17 pm
by Angrycrow
Animations have been removed from the next version?

Maybe there is a way to reconstruct movieclip animations from flash. In CS3+ you can export an animation behavior to an XML file. Maybe there is a way to reconstruct those transitions. It seems kind of far off.

Is there any news around the community for people developing software with love that IS a game building tool. Something that interactive that works with TILEd or some kind of visual asset manager for game objects. Like a UI/ game state builder.

Seriously if it comes down to it I'll just be writing lua modules for a little while.

On a side note. If I want to make 'loading' Screens, or even manage large amounts of assets how do I getBytesLoaded()/total(). How does LOVE/ lua handle data on that level?

Re: Animating Effects/Transitions

Posted: Sat Sep 12, 2009 11:10 pm
by Robin
Angrycrow wrote:Animations have been removed from the next version?
The good news: it has a replacement. bartbes wrote a Lua library (AnAL) for that purpose.
Angrycrow wrote:Maybe there is a way to reconstruct movieclip animations from flash. In CS3+ you can export an animation behavior to an XML file. Maybe there is a way to reconstruct those transitions. It seems kind of far off.
nn...I don't think that'll be easy. Lua is not so strong with XML, I think.
Angrycrow wrote:On a side note. If I want to make 'loading' Screens, or even manage large amounts of assets how do I getBytesLoaded()/total(). How does LOVE/ lua handle data on that level?
AFAIK, the only way to do it is to guesstimate the amount to load:

Code: Select all

dataToLoad = {{"img1.png", 23192}, {"img2.png", 46414}, {"img3.png", 94620}} --filename=size
images = {}
totaltoload = 0
for i,v in ipairs(dataToLoad) do
    totaltoload = totaltoload + v[2]
end

function load()
     loadingstate = 1
     loaded = 0
end

function update(dt)
    if loadingstate <= #dataToLoad then
        images[loadingstate] = love.graphics.newImage(dataToLoad[loadingstate][1])
        loaded = loaded + dataToLoad[loadingstate][2]
        loadingstate = loadingstate + 1
    else
        --game logic here
    end
end

function draw()
    --do something with totaltoload and loaded
end

Re: Animating Effects/Transitions

Posted: Sun Sep 13, 2009 1:05 am
by Angrycrow
Thanks! This looks interesting.

For something like this I'd rather fake it anyway. It really doesn't matter to me or the player exactly what percentage is loading. I'm pretty sure I can use this to fake it.

Do you know when the next version is supposed to come along?

Re: Animating Effects/Transitions

Posted: Sun Sep 13, 2009 6:02 am
by bartbes
I know the standard C way is seeking to the end and using tell to get the position, however I do know PhysFS has a length function.

Re: Animating Effects/Transitions

Posted: Sun Sep 20, 2009 8:37 am
by zugamifk
I seem to remember that LOVE supports additive blending. Could you use that for highlighting buttons or somesuch?

Re: Animating Effects/Transitions

Posted: Tue Sep 29, 2009 6:43 pm
by Angrycrow
Definitely. I'm going to use color definitions with the alpha changing over time.

like.

full = 255
color [Black] (0,0,0,opa)

while opa < full
opa +=5
end


When it comes to handling time with love do I want to just get the difference between the os Time ? Is there a faster way to get a millisecond clock?

Re: Animating Effects/Transitions

Posted: Tue Sep 29, 2009 6:45 pm
by Robin
Angrycrow wrote:When it comes to handling time with love do I want to just get the difference between the os Time ? Is there a faster way to get a millisecond clock?
Do you mean the dt variable?