1 decade ago
by Joncom
I have a background layer in my map that is repeating.
I'd like it to continue repeating, but only on the x-axis. Can this be done without modifying the files within lib/impact/?
I'd try and make it the same height as your main map, and then experiment with scale, and larger-than-screen maps, to see how that holds.
1 decade ago
by Joncom
If I were to make it the same size as my map, it still repeats above the map.
My player is allowed to move to the top of the map and see into the -y values.
I'd like it if he would see black above and below the map, and repeated background to the left and right of the map.
Can you post a screenshot of actual vs. desired results? I have difficulty imagining what you mean.
1 decade ago
by paulh
not in this version, as far as im aware.
Alexande, he means a tiling background horizontally and not vertically
I see. Yes, then in that case you'd have to extend or inject into backgroundMaps.js, add repeatX and repeatY props defaulting to false, set key/values for that in wm, and override drawPreRendered and drawTiled methods. At first glance it seems not so hard but then again I always say that... :)
1 decade ago
by Joncom
Quote from paulh
He means a tiling background horizontally and not vertically
Yes.
Quote from alexandre
In that case you'd have to extend or inject into backgroundMaps.js
What exactly do you mean when you say "inject"?
EDIT: Nevermind, I guess I could have just looked it up myself lol.
.inject() works similar to .extend() but does not create a new Class - instead, it changes the Class in place. This is useful if you want to change the behavior of one of Impacts classes without changing the engine's source code, e.g. for plugins.
Thank you. This looks like it may be my solution.
Page 1 of 1
« first
« previous
next ›
last »