Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Joncom

I see distance="1" when I look at my map with a text editor, and I'm just curious what that means.

What is the distance property of a layer (in a map) used for?

1 decade ago by Graphikos

http://impactjs.com/documentation/class-reference/backgroundmap#distance
Distance factor of the BackgroundMap, indicating how fast the Map scrolls when .setScreenPos() is invoked. With a distance of 1, the Map scrolls synchronous to the screen. With a distance of 2 the Map scrolls with half the speed, making it appear farther in the background. The default is 1

In short, its for the parallax effect.

1 decade ago by Joncom

Very cool, thx!
Page 1 of 1
« first « previous next › last »