Building a level editor using the full capabilities of the existing Game Maker engine can lead to some interesting if not frustrating discoveries. The last of the bunch, was related to a certain facet of the option of built-in GM backgrounds’ ability to be set as a foreground. Picture the following: set a background to tile both horizontally and vertically, then set it as a foreground image. Result: the editor is obscured by a background :S. Since the setting is simply “set as foregroundâ€? there is no way of setting a depth for the rest of the editor that would allow it to be shown above the background.
Now there are several ways around this. An obvious one would be to emulate foreground behavior, by creating a fake background, for instance using draw_vertex_texture() in combination with texture_set_repeat(). This would become a bit troublesome if I only needed to repeat either vertically or horizontally.But I have found another way, of which I was very amazed it existed. I bumped in it by accident. You see, if you tile, the chosen background is tiled indefinitely in the chosen tile direction. Or is it…? You see, when you tile horizontally, you can go as far to the left as to the right and you will see re-tiling wherever you go. If you would however tile vertically, this repetition stops when passing the origin… what? Yes if you get into negative space you are spared the sight of repeated tiles.I'll explain it a bit better using the image below![Image](http://img91.imageshack.us/img91/9932/scrbgtilingfgmm0.th.png)
![Image](http://img91.imageshack.us/images/thpix.gif)
In other news…
Next to tripping over this wire (I was almost finished with implementing backgrounds *shaking fist in anger*) I have been enjoying the little Cave Story medley link provided by the good patrons at IndieGames. I have even downloaded the rip found in the comments (as the playing artist didn’t mind). The more busy pieces are a bit chaotic, but almost all the softer pieces are done very well, especially Gestation, Cemetary, Geothermal and Moonsong are done really well and come out stronger in this all-piano form. Some pieces are sadly missing, most notable being Meltdown 2 and Scorching Back. Also, Balcony was sadly cut short (perhaps he was tired playing so long already and eager to finish). I definitely recommend taking the time to listen through the entire 23+ minutes.![Image](http://endingb.com/images/outerwall.jpg)
AWESOMEness:
Game + Level Editor = Game with lot's of intriguing levels.Great way to go, instead of using gamemaker's built in level editor.you can make layers invisible in the gm editor.
click on the dropdown list beside the magnifying glass on the editor.And why not emulate tiled texture drawing with a loop?
I think it would be far easier to come up with a simple script to just draw the foreground image behind the editor GUI without using the built in foreground variable. This would also allow for more flexibility. You don't necessarily have to use the draw vertex stuff, just use a couple for loops and draw_background or something.
Also, level editors are a great idea :Dor you could leave it a background and use background_foreground[x] in the room creation code.
@__Player__:
1. Yes you can turn off all backgrounds and all objects and all tiles, but you cannot do it per background or by a given tiling depth (not to mention object depth). So it is improving on GMs limitations.2. I am using background_foreground. That's working fnie. The trouble is, that if you continuously-tile both horizontally as vertically, setting a background as foreground wil cover the screen.@All:If you read beyond the "use draw_vertex" part, you see it is also possible to do it otherwise. I guess I wasn't so clear on it the first time. I will add a picture and elaborate some more to clearify.