[Solved] Animations And Love bugged?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- shatterblast
- Party member
- Posts: 136
- Joined: Tue Dec 11, 2012 9:47 pm
- Location: Dallas, Texas, USA
[Solved] Animations And Love bugged?
I've tried using animation:reset() with 0.80 of Love, but it just keeps feeding back error messages. I figure at the moment that I can just try another library. Can someone else confirm this, and how should I respond?
Last edited by shatterblast on Sat Feb 02, 2013 6:59 pm, edited 1 time in total.
- shatterblast
- Party member
- Posts: 136
- Joined: Tue Dec 11, 2012 9:47 pm
- Location: Dallas, Texas, USA
Re: Animations And Love bugged?
Yeah, I'm pretty sure part of ANaL has broke since the Love 0.80 update. The same issues appear in this thread:
http://love2d.org/forums/viewtopic.php? ... nal#p32742
I can't get anim8 to work for me. Can someone please suggest an alternative for animations? I guess I could try to set up my own functions.
http://love2d.org/forums/viewtopic.php? ... nal#p32742
I can't get anim8 to work for me. Can someone please suggest an alternative for animations? I guess I could try to set up my own functions.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Animations And Love bugged?
You do realize that those things happened in 2011, and have since long been fixed?
Can you at least post the errors, some code, anything at all? (Don't say it's unreasonable of me to ask, the forum guidelines tell you to do this to begin with!)
Can you at least post the errors, some code, anything at all? (Don't say it's unreasonable of me to ask, the forum guidelines tell you to do this to begin with!)
- shatterblast
- Party member
- Posts: 136
- Joined: Tue Dec 11, 2012 9:47 pm
- Location: Dallas, Texas, USA
Re: Animations And Love bugged?
I suppose I must first apologize. I was using an outdated version of anal.lua. I re-downloaded the version of anal.lua from the Wiki, and now the crashing has stopped.
However, it leads to another problem. The animations I test with animation:reset() freeze at the first frame. I don't know if this is because of my operating system or what. (I'm using Ubuntu Linux 12.04 with a Pentium 4 processor, 3 gigs of memory, and an nVidia graphics card.) I haven't tested with Love 0.72 to know the difference.
Anyhow, here's my present code from main.lua and test files to show how the :reset() works with my testing. Maybe I'm just using :reset() wrong. I don't know.
However, it leads to another problem. The animations I test with animation:reset() freeze at the first frame. I don't know if this is because of my operating system or what. (I'm using Ubuntu Linux 12.04 with a Pentium 4 processor, 3 gigs of memory, and an nVidia graphics card.) I haven't tested with Love 0.72 to know the difference.
Anyhow, here's my present code from main.lua and test files to show how the :reset() works with my testing. Maybe I'm just using :reset() wrong. I don't know.
Code: Select all
function love.load()
require("anal")
spritesheet = love.graphics.newImage("sparkle_test.png")
spritesheet:setFilter("nearest", "nearest")
animation = newAnimation(spritesheet, 192, 192, 0.1, 111)
--______________________________________________________________________
spritesheet2 = love.graphics.newImage("healing_circle.png")
spritesheet2:setFilter("nearest", "nearest")
animation2 = newAnimation(spritesheet2, 192, 192, 0.1, 47)
--______________________________________________________________________
animationState = "Effect_1"
end
function love.update(dt)
animation:update(dt)
animation2:update(dt)
end
function love.draw()
love.graphics.print("Press 1 or 2 to alternate between animations.", 50, 50)
love.graphics.print(animationState, 50, 80)
if animationState == "Effect_1" then
animation:setMode("loop")
animation:draw(200, 200)
animation:reset() -- <--- Here I have the trouble. <---
elseif animationState == "Effect_2" then
animation2:setMode("loop")
animation2:draw(200, 200)
animation2:reset() -- <--- Here I have the trouble. <---
end
end
function love.keypressed(key)
if key == "1" then
animationState = "Effect_1"
elseif key == "2" then
animationState = "Effect_2"
end
end
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Animations And Love bugged?
Well, yes, you're resetting every frame, of course you'll only see the first animation frame, what did you expect?
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Animations And Love bugged?
This is probably my fault. I somehow missed your question in the anim8 thread. I've just answered, in case you still want to give it a try.shatterblast wrote:I can't get anim8 to work for me.
When I write def I mean function.
- shatterblast
- Party member
- Posts: 136
- Joined: Tue Dec 11, 2012 9:47 pm
- Location: Dallas, Texas, USA
Re: Animations And Love bugged?
I was assuming it would reset only once. I guess I'll go back and make a function that tests what frame is currently playing, and then reset at that point.bartbes wrote:Well, yes, you're resetting every frame, of course you'll only see the first animation frame, what did you expect?
I'd like to try at a later date. Thank you. I would still like to give it a try.kikito wrote:This is probably my fault. I somehow missed your question in the anim8 thread. I've just answered, in case you still want to give it a try.shatterblast wrote:I can't get anim8 to work for me.
Thanks to both of you for answering me. It gives me some things to figure out.
Re: [Solved] Animations And Love bugged?
The animations I test with animation:reset() freeze at the first frame? Anywork, it works.
- shatterblast
- Party member
- Posts: 136
- Joined: Tue Dec 11, 2012 9:47 pm
- Location: Dallas, Texas, USA
Re: [Solved] Animations And Love bugged?
Here is the final working code for anyone who might find it useful. Instead of looping, it now only plays once per animation load and resets at the press of key 1 or 2. (Not the number pad.)
The first animation is a little scruffy, but it's just for testing purposes anyhow.
main.lua :
The first animation is a little scruffy, but it's just for testing purposes anyhow.
main.lua :
Code: Select all
function love.load()
require("anal")
spritesheet = love.graphics.newImage("sparkle_test.png")
spritesheet:setFilter("nearest", "nearest")
animation = newAnimation(spritesheet, 192, 192, 0.1, 110)
--______________________________________________________________________
spritesheet2 = love.graphics.newImage("healing_circle.png")
spritesheet2:setFilter("nearest", "nearest")
animation2 = newAnimation(spritesheet2, 192, 192, 0.1, 50)
--______________________________________________________________________
animationState = "Effect_1"
end
function love.update(dt)
animation:update(dt)
animation2:update(dt)
end
function love.draw()
love.graphics.print("Press 1 or 2 to alternate between animations.", 50, 50)
love.graphics.print(animationState, 50, 80)
if animationState == "Effect_1" then
animation:setMode("once")
animation:draw(200, 200)
elseif animationState == "Effect_2" then
animation2:setMode("once")
animation2:draw(200, 200)
end
end
function love.keypressed(key)
if key == "1" then
animationState = "Effect_1"
animation:reset()
animation:play()
elseif key == "2" then
animationState = "Effect_2"
animation2:reset()
animation2:play()
end
end
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests