Giter VIP home page Giter VIP logo

parallax-class's Introduction

====================================================================      
 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 )

====================================================================

parallax-class's People

Contributors

tcatania avatar theideamen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

parallax-class's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.