theideamen / parallax-class Goto Github PK
View Code? Open in Web Editor NEWA class for Corona SDK that makes it easy to set up parallax animations for backgrounds.
A class for Corona SDK that makes it easy to set up parallax animations for backgrounds.
==================================================================== PARALLAX CLASS ==================================================================== Version: 0.8 Made by Griffin Adams ( theIdeaMen ) 2011-2012 Twitter: http://www.twitter.com/theIdeaMen eMail: [email protected] MIT License You can use and change this code free of purgery or death as long as you promise to have fun or something along those lines. Thanks to Brent Sorrentino for a great parallax demo, the the starting point from witch this class was born. Feedback welcome! ==================================================================== CHANGES ==================================================================== 03-02-2015 - Tim Catania - Replaced depreciated setReferencePoint 02-05-2012 - Griffin Adams - Major update/rewrite - see 'Old' branch for previous history ==================================================================== INFORMATION ==================================================================== * Import the class like this: parallax = require( "parallax" ) * To create a new scene yourScene = parallax.newScene( { width = [X SCENE SIZE], height = [Y SCENE SIZE], left = [SCENE X BEGINNING POS], top = [SCENE Y BEGINNING POS], [repeated = [REPEAT FOREVER, "horizontal","vertical","both"] } ) * To add a new layer to the scene yourScene:newLayer( { image = [IMAGE NAME], width = [IMAGE WIDTH], height = [IMAGE HEIGHT], [top = [IMAGE Y POS],] [bottom = [IMAGE Y POS],] left = [IMAGE X POS], speed = [HOW FAST, 0 - 1 for backgrounds, > 1 for foregrounds], [repeated = [INF SCROLL, "horizontal","vertical","both"]] } ) NOTE: Create your layers in order from closest to farthest away NOTE: All x/y coordinates should be in relation to the screen (not local) * To add objects to a layer yourScene:insertObj( object, [layer] ) NOTE: If no layer specified, defaults to the top layer * To move a scene yourScene:move( deltaX, deltaY ) ====================================================================
I tested this repo. Its work. I just replace setReferencePoint to object.anchorX/Y and everything work as well.
here the edited and tested file
https://dl.dropboxusercontent.com/u/20694523/duff333.Parallax-Class/main.lua
https://dl.dropboxusercontent.com/u/20694523/duff333.Parallax-Class/parallax.lua
Thx duff333.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.