LittleJS 1.28.0

Parallax

LittleJS Parallax Plugin

  • A background layer that follows the camera by a part of its movement, so it looks far away
  • Repeats across the view, so a level of any width has a background
  • Draws mountains by default, or anything a game draws into it

Classes

Functions

Functions

parallaxMountains(topColor, bottomColor, seed) → functionparallax.js:159

A draw function for a ParallaxLayer: a range of mountains across the image, shaded from the color of their peaks down to the color of their feet, that repeats with no seam

topColor Color optional

Color at the peaks

bottomColor Color optional

Color at the bottom of the image

seed number optional

The same seed gives the same mountains, random when not given