[library] cron.lua - time management for LÖVE - v2.0 is out!
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: cron.lua
This might be useful for me. I had been wondering how to do timing correctly for a while. Especially for stuff like cinematics where stuff needs to be moving and disappearing and appearing at specific times.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: cron.lua
Hi jasoco!
Definitively, it can help with the "measure time" part. For resolving the whole cinematics thing you will need different stuff.
It's actually funny that you mention it, I've been thinking about cinematics in lua since I read a question about them in stack overflow two weeks ago. Open another thread if you need help with them; I might be able to surprise you.
Definitively, it can help with the "measure time" part. For resolving the whole cinematics thing you will need different stuff.
It's actually funny that you mention it, I've been thinking about cinematics in lua since I read a question about them in stack overflow two weeks ago. Open another thread if you need help with them; I might be able to surprise you.
When I write def I mean function.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: cron.lua
Thing is I was hoping to create something that works along the lines of Apple's "Core Animation" where you have objects and can tell them to animate from one place to another and have stuff happen when they're finished or all of them finish or whatever. If you use OS X or iOS a lot, you know what I mean. Everything is animated via Core Animation in OS X/iOS.kikito wrote:Hi jasoco!
Definitively, it can help with the "measure time" part. For resolving the whole cinematics thing you will need different stuff.
It's actually funny that you mention it, I've been thinking about cinematics in lua since I read a question about them in stack overflow two weeks ago. Open another thread if you need help with them; I might be able to surprise you.
Of course I'd tried simple methods before, but nothing really solid. Plus I don't have any content.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: cron.lua
Ah ha, you're wanting a tweening library with the ability to tween properties. You're about to release a library to do that aren't you kikito?Jasoco wrote:Thing is I was hoping to create something that works along the lines of Apple's "Core Animation" where you have objects and can tell them to animate from one place to another and have stuff happen when they're finished or all of them finish or whatever. If you use OS X or iOS a lot, you know what I mean. Everything is animated via Core Animation in OS X/iOS.kikito wrote:Hi jasoco!
Definitively, it can help with the "measure time" part. For resolving the whole cinematics thing you will need different stuff.
It's actually funny that you mention it, I've been thinking about cinematics in lua since I read a question about them in stack overflow two weeks ago. Open another thread if you need help with them; I might be able to surprise you.
Of course I'd tried simple methods before, but nothing really solid. Plus I don't have any content.
Something that I think would help cinematics is a timeline library, like Greensock's TimelineLite/TimelineMax for Flash.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: cron.lua
Basically something like this:BlackBulletIV wrote:Ah ha, you're wanting a tweening library with the ability to tween properties. You're about to release a library to do that aren't you kikito?Jasoco wrote:Thing is I was hoping to create something that works along the lines of Apple's "Core Animation" where you have objects and can tell them to animate from one place to another and have stuff happen when they're finished or all of them finish or whatever. If you use OS X or iOS a lot, you know what I mean. Everything is animated via Core Animation in OS X/iOS.
Of course I'd tried simple methods before, but nothing really solid. Plus I don't have any content.
Something that I think would help cinematics is a timeline library, like Greensock's TimelineLite/TimelineMax for Flash.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: cron.lua
Wow that's pretty cool. Yeah a tweening library would be best for that job.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: cron.lua
I agree. A tweening library would be very good for performing things like those "zoom in/zoom out" operations (as well as fade-ins, gradual color changes, gradual volume up/down in music, etc).
As BlackBulletIV was saying, I was planning to implement a library for making tweening easy in Lua, as I've got a bank holiday next monday.
My lib is going to be inspired in jquery's animate function (scroll down to see some examples). Mine will probably have less functionality though.
The interface is already defined and it's going to be very minimalistic, like in memoize, cron and inspect: 2 main functions, with 2 additional ones for extra stuff that will not be used most of the time.
All in all, note that there are already some solutions out there for tweeing out there:
As BlackBulletIV was saying, I was planning to implement a library for making tweening easy in Lua, as I've got a bank holiday next monday.
My lib is going to be inspired in jquery's animate function (scroll down to see some examples). Mine will probably have less functionality though.
The interface is already defined and it's going to be very minimalistic, like in memoize, cron and inspect: 2 main functions, with 2 additional ones for extra stuff that will not be used most of the time.
All in all, note that there are already some solutions out there for tweeing out there:
When I write def I mean function.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: cron.lua
Quick update: I've made a couple small changes in cron.lua
EDIT: the tweening library was released months ago, but I forgot to update this thread. Here it is: tween.lua
- It now liberates more memory than before (not all of it, but still)
- It supports funcTables (tables with a _call metamethod) in addition to functions
EDIT: the tweening library was released months ago, but I forgot to update this thread. Here it is: tween.lua
When I write def I mean function.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: cron.lua
cron.lua update!
I've released a new version (1.2)
The big change in cron.lua 1.2 is a new method, cron.tagged. It allows tagging time entries, as well as updating them/cancelling them in groups:
Other changes:
I've released a new version (1.2)
The big change in cron.lua 1.2 is a new method, cron.tagged. It allows tagging time entries, as well as updating them/cancelling them in groups:
Code: Select all
local cron = require 'cron'
cron.tagged('main-menu','menu').after(5, showMenu)
...
cron.tagged('main-menu').update(dt)
cron.tagged('menu').cancel()
- Minor changes/optimizations (contributed by hahawoo
- Tests have been improved
When I write def I mean function.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: [library] cron.lua - time management for LÖVE
If you use cron.update, does it update all tags too?
Who is online
Users browsing this forum: No registered users and 3 guests