Animation Chain

Posted by tap32, Posted on June 18, 2013

GitHub URL: 
https://github.com/personalnadir/animation

Wraps transition.to calls up to allow jQuery style function chains such as:

1
animationchain.anim(obj,options).whenDone(obj2,options).onStart(obj3,options).start()

I wrote this to avoid confusing callback hell. Feel free to expand, optimise or correct this!

I've not tested the performance, but I expect it to be somewhat worse, however my focus was on code structure, not speed.

For up to date code and an example main.lua, use GitHub

1
2
3
4
5
6
7
local M={}
animationchain=M
 
local transition=transition
local setmetatable=setmetatable
 
setfenv(1,M)

Mario Style "Star" Effect

Posted by naveen_pcs, Posted on April 20, 2013

This will make an effect where your screen will flash through random colours like when you have a Star in Mario. The effect will cover the entire screen and it's self contained in a single lua file. All cleanup will automatically be done after the animation is finished (or if you end it early by calling stop() - see below for more details)

Require the module:

 local rainbowScreen = require("rainbowscreen")

Then when you want to use it:

 rainbowScreen.new({duration = 300, colorChangeTime = 150, screenCoverAlpha = 0.25})

Easy setFillColor Transition

Posted by bfintal, Posted on April 16, 2013

Here're 2 small self-contained functions you can use to perform a smooth transition for fillcolors:

Usage:

Initially set a fill color via: (We need this so that we can know what the color to transition FROM is)

1
2
local g = display.newRect(0, 0, 100, 100)
setFillColor(78, 186, 248)

Then just call the set fill color transition via:

1
2
-- sets the color of 'g' to {255, 128, 0} for 3000 milliseconds
setFillColorTransition(g, 255, 128, 0, 3000)

Transition Manager

Posted by stephannvasconcelos, Posted on February 15, 2013

GitHub URL: 
https://github.com/stephannvasconcelos/kw/blob/master/TransitionManager.lua

The Transtion Manager was developed for transitions could be paused and resumed

Usage example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local TransitionManager = require 'TranstionManager'
local isPaused = false
 
local transitionManager = TransitionManager.new()
 
local circle = display.newCircle(100,100, 40)
local rect = display.newRect(10,10, 40, 40)
 
local function pause()
    if isPaused then
        isPaused = false
        transitionManager:resume()
    else
        isPaused = true
        transitionManager:pause()
    end
end
 
Runtime:addEventListener('tap', pause)

Improved Transition Function Calls

Posted by TimeSpaceMagic, Posted on June 24, 2012

GitHub URL: 
https://github.com/timespacemagic/coronaSDK/blob/master/tran.lua

I thought the current Corona transition methods are not exactly very customizable and has limited animation easings.

Furthermore:
1) You can't pause it easily. No pause ALL transition function either
2) There's a bug in the transition.from() method call if you enable delta = true

Solution:
I'll code the entire transition API from scratch. Using equations courtesy of Robert Penner that can be found at: http://www.robertpenner.com/easing/ , I've coded a brand new transition call.

Stuff to note:
1. Fixed the bug in the transition.from() call with delta enabled.

Color Transition Wrapper

Posted by atoko, Posted on May 9, 2012

Since changing color smoothly seems like a task that pops up often during game development, I decided to make a wrapper function (around Corona's default transition.to) in order to make it easier.

TO USE :
First load the table that contains the function:

1       cTrans = require("colortransition")

Then call the wrapper function as such:

 cTrans:colorTransition(displayObject, colorFrom, colorTo, [time], [delay], [easing]) ;

i.e.

 cTrans:colorTransition(rect, {255,255,255} , {0,0,0}, 500)

transition class library

Posted by krishnarajsalim., Posted on March 24, 2012, Last updated April 1, 2012

GitHub URL: 
https://gist.github.com/2178984

--====================================================================--
-- TRANSITION CLASS
--====================================================================--

--[[

- Version: 1.0
- Made by Krishna Raj Salim @ 2012
- linkedin profile : in.linkedin.com/in/krishnarajsalim
- facebook profile : www.facebook.com/krishnarajsalim
- Mail: krishnarajsalim@gmail.com

******************
- INFORMATION
******************

- This class is free to use, feel free to change but please send new versions

Animated Number Ticker

Posted by bryan.vaccaro, Posted on December 13, 2011

I wrote this snippet as a proof of concept for a score/time keeper in a game I'm currently working on.

The createTicker() function takes two parameters: a number, and the number of digits you want the display to be. It then generates a 'card' for each digit, based on the width and height of the number font + padding.

Pausable Transitions - A very simple method

Posted by Satheesh, Posted on November 26, 2011, Last updated November 28, 2011

GitHub URL: 
https://github.com/SatheeshJM/simple_transition_pausing_from_Satheesh

Yeah I know there are a lot of transition managers.. Still never hurts to share code.. So here goes.

USAGE :

1
2
3
transition.to(object,params}
transition.pause(object)    
transition.resume(object)

I am not sure about the efficiency of this module. So if anyone has any modifications or if anyone finds any bug, please comment below.

And I haven't tested this completely, but till now, it has worked fine for me :)

https://github.com/SatheeshJM/simple_transition_pausing_from_Satheesh

1
2
-- A very Simple Pausable Transition
-- Author: Satheesh

Sequence.lua - Transition Execution order

Posted by calledpaul, Posted on October 17, 2011

Hello everybody!

I am a bit new to Corona but i am working on a game template. Below you can find the class i wrote to handle sequential animations (function calls). It's really easy but i think it will be helpful for somebody here.
My idea is to integrate it with TransitionManager somehow, but still havent stated with that, if somebody has any ideas about it i will be glad to here them.
PS: I think methods like stopTransitions and pauseTransitions should be implemented here.

Any feedback or improvements will be appreciated!