Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2014-7-16 16:20

Class jaws.Parallax

Manage a parallax scroller with different layers. "Field Summary" contains options for the Parallax()-constructor.

Class Summary
Constructor Attributes Constructor Name and Description
 
jaws.Parallax(options)
Field Summary
Field Attributes Field Name and Description
 
number, x-position of "camera".
 
number, y-position of "camera".
 
true|false, repeat all parallax layers horizontally
 
true|false, repeat all parallax layers vertically
 
number, scale factor for all layers (2 will double everything and so on)

Method Summary

Method Attributes Method Name and Description
 
addLayer(options)
Add a new layer to the parallax scroller
 
draw(options)
Draw all layers in parallax scroller
 
Debugstring for Parallax()

Class Detail

jaws.Parallax(options)
parallax = new jaws.Parallax({repeat_x: true})
parallax.addLayer({image: "parallax_1.png", damping: 100})
parallax.addLayer({image: "parallax_2.png", damping: 6})
parallax.camera_x += 1    // scroll layers horizontally
parallax.draw()
Parameters:
options

Field Detail

camera_x
number, x-position of "camera". add to camera_x and layers will scroll left. defaults to 0
camera_y
number, y-position of "camera". defaults to 0
repeat_x
true|false, repeat all parallax layers horizontally
repeat_y
true|false, repeat all parallax layers vertically
scale
number, scale factor for all layers (2 will double everything and so on)

Method Detail

  • addLayer(options)
    Add a new layer to the parallax scroller
    Parameters:
    options
  • draw(options)
    Draw all layers in parallax scroller
    Parameters:
    options
  • toString()
    Debugstring for Parallax()