@rxi
thank you very much for that. ill have a look after ive finished some code ive been putting off
flux: A fast, lightweight tweening library
- smoking bunny
- Citizen
- Posts: 67
- Joined: Wed May 07, 2014 9:04 am
- Contact:
Re: flux: A fast, lightweight tweening library
lewis lepton
------
composer | sound designer | tinkerer
smoking bunny | bandcamp | twitter | gitHub | vimeo
------
composer | sound designer | tinkerer
smoking bunny | bandcamp | twitter | gitHub | vimeo
Re: flux: A fast, lightweight tweening library
You are right. It's an issue with love-loader. The finishedCallback is called twice. Now I need to find the reason.
Sorry to take your time. Thank you for the nice example. Flux is great!
Sorry to take your time. Thank you for the nice example. Flux is great!
Re: flux: A fast, lightweight tweening library
So, maybe it's an love-loader problem.
Here is an sample with love-loader. Look at the console...after love-loader has loaded the image...the callback function is called twice. But without the first tween it's only called once.
Here is an sample with love-loader. Look at the console...after love-loader has loaded the image...the callback function is called twice. But without the first tween it's only called once.
- Attachments
-
- oncomplete2.love
- (19.24 KiB) Downloaded 276 times
Re: flux: A fast, lightweight tweening library
Each ncomplete() callback was run only once when I ran it:SiENcE wrote:So, maybe it's an love-loader problem.
Here is an sample with love-loader. Look at the console...after love-loader has loaded the image...the callback function is called twice. But without the first tween it's only called once.
Code: Select all
first tween finished
image table: 0x00dd47b8 left-hand-climber-hi
second tween finished
Re: flux: A fast, lightweight tweening library
hi rxi,
me again. I analyzed the problem and it might have todo with LuaJit.
I get different results when executing it several times.
Sometimes i get what you say.
But sometimes I also get this:
When I use Zerobrane Studio and start in debug mode...I get the expected result. But when I just press play, I sometimes get the second result. So I think, it has todo with love-loader, timing, threads or Luajit!?
me again. I analyzed the problem and it might have todo with LuaJit.
I get different results when executing it several times.
Sometimes i get what you say.
Code: Select all
first tween finished
image table: 0x02945188 left-hand-climber-hi
second tween finished
Code: Select all
first tween finished
image table: 0x02945188 left-hand-climber-hi
second tween finished
second tween finished
Re: flux: A fast, lightweight tweening library
I suspect that threads would be your most likely culprit if sometimes it works and sometimes it doesn't and everything else is basically identical between runs.SiENcE wrote:I get different results when executing it several times
You may need to hit up the author of love-loader to try and work this out. I haven't touched threads in LÖVE, so I can't be of much help in that regard.
As a quick fix in the mean time you could try creating callback functions that only execute once, you can wrap your callback with lume's once() function to do this easily, or create a local boolean outside the function which the function checks before it runs. This obviously isn't an ideal fix, and may not even work if threads are the issue here.
Re: flux: A fast, lightweight tweening library
Yeah I already wrote this in the love-loader thread.
The boolean is a good work around, but i hope love-loader could be fixed.
Thanks for your suggestions!
The boolean is a good work around, but i hope love-loader could be fixed.
Thanks for your suggestions!
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: flux: A fast, lightweight tweening library
This library is amazing. I started using it in a new project. So much easier than writing my own tweens. So awesome.
I do wish it had some more Easing options. Like bounce.
Also, some ways of modifying parameters of the Easing functions. Like how much "over" the Elastic function goes. Or how many times it would bounce with a Bounce call.
Keep it going! So useful!
I do wish it had some more Easing options. Like bounce.
Also, some ways of modifying parameters of the Easing functions. Like how much "over" the Elastic function goes. Or how many times it would bounce with a Bounce call.
Keep it going! So useful!
Re: flux: A fast, lightweight tweening library
I don't have any plans to add more easing functions to flux for the moment. You are able to add your own easing functions for your project easily though by assigning a new one to the flux.easing table.Jasoco wrote:[...] I do wish it had some more Easing options. Like bounce.
An easing function should take a single parameter, a number between 0 and 1 which represents the tween's linear progress. It should return a value between 0 and 1 which represents the progress we actually want to be applied. For example, if we wanted to add an easing function which randomly jittered the tweened values while it was moving to the destination, we could do:
Code: Select all
flux.easing["jitter"] = function(p)
return p + (1 - math.random() * 2) * 0.04
end
Likewise, a tween with a custom backout value could be done as follows:
Code: Select all
local amount = 4
flux.easing["backout2"] = function(p)
p = 1 - p
return 1 - (p * p * ((2 + amount) * p - (1 + amount)))
end
Who is online
Users browsing this forum: Google [Bot] and 5 guests