Page 2 of 4

Re: tween.lua

Posted: Sat Apr 28, 2012 2:25 pm
by kikito
Oh, ok. Fixed that too, thanks a lot!

Re: tween.lua

Posted: Sat Aug 25, 2012 3:48 pm
by KingRecycle
It seems for me the callback is being called right away and not when the tween is finished.

Re: tween.lua

Posted: Sat Aug 25, 2012 8:36 pm
by kikito
What code are you using? Have you seen the demo?

Re: tween.lua

Posted: Sun Aug 26, 2012 2:33 am
by KingRecycle
Oh...so that is how you do it. Whoops. Thanks.

Re: tween.lua

Posted: Sun Aug 26, 2012 11:19 am
by kikito
:) no problemo

Re: tween.lua

Posted: Sun Nov 18, 2012 8:25 pm
by mangadrive
I've been messing with this for the past 30 mins and I cannot get anything to draw. I'm fairly certain I have it hooked up right, but even the basic demo examples won't work.

Re: tween.lua

Posted: Sun Nov 18, 2012 8:57 pm
by kikito
mangadrive wrote:I've been messing with this for the past 30 mins and I cannot get anything to draw. I'm fairly certain I have it hooked up right, but even the basic demo examples won't work.
Hello there.

I'd like to help you, but I'm afraid your message is too vage. By reading this, all I can tell you is "Sorry, you must be doing something wrong in your code".

In order to give you a more helpful answer, I'd need more. Something that helps me see the problem. Reading the code that you wrote would almost certainly help. The whole .love file, even if it draws nothing, would be even better.

Re: tween.lua

Posted: Sun Nov 18, 2012 9:13 pm
by mangadrive
I'm using your coded examples from your git. Maybe not correctly but it's your code.

Code: Select all

function love.load()



local tween = require 'tween'


end


function love.draw()

local backgroundColor = {255,255,255}
tween(2, backgroundColor, {0,0,0}, 'linear', print, "hello!")



local label = { x=200, y=0, text = "hello" }
tween(4, label, { y=300 }, 'outBounce')


end


function love.update(dt)
  
tween.update(dt)


end
Using require tween with local gives a nil value.. If I remove local it runs, and when you call the console it prints, but I see no tweens. I've required "tween" as in pointing to the lua file itself. I've set the background different colors, I've run with and without bat. I've put the globals in load, i've put them in draw. I've divided the code up every which way.. Your "traffic light" example on the git doesn't work either due to syntax. I'm still kind of new to Love 2d and LUA. I respect that you aren't entitled to teach people these things to use your library, but either I translated the information poorly (more likely) or there wasn't enough.

I hope that didn't sound disrespectful. Just meaning I didn't know how to use the code or examples you provide without getting erroneous results.

Re: tween.lua

Posted: Sun Nov 18, 2012 9:33 pm
by kikito
Oh, I see.

In general (like 95% of the time), require statements are at the beginning of each file, and outside all functions.

Try putting the `local tween = require 'tween'` line outside of love.load:

Code: Select all

local tween = require 'tween'

function love.load()
 -- whatever else you want to put here
end

function love.draw()
  -- same as before
end

Re: tween.lua

Posted: Sun Nov 18, 2012 9:50 pm
by mangadrive
I guess I'm missing something very valuable here or my super_noob status is level 9k+

Code: Select all

local tween = require 'tween'


function love.draw()

love.graphics.setColor(255,255,255,255)
love.graphics.print("test",0,0)


local label = { x=200, y=0, text = "hello" }
tween(4, label, { y=300 }, 'outBounce')


end


function love.update(dt)
  
tween.update(dt)

end
Still just a black screen with "test". No tweens.