Spherical forums

Sphere Development => Sphere Support => Map/Tileset Support => Topic started by: ninjasword on June 19, 2013, 11:16:44 am

Title: map layers and transparency
Post by: ninjasword on June 19, 2013, 11:16:44 am
i wanted to have some nice water FX and i thot i could play with layers to get there

the idea was an opaque 'ocean floor' layer, with a partially clear paralax layer right over that, then a partially clear scrolling layer on top. these three layers would then be under a ground layer that u walk around on.

when i fill a layer with tiles that have transparent and opaque pixels, the engine renders a black layer behind that tile, and u cant see thru it to the tiles below... i think

Title: Re: map layers and transparency
Post by: Radnen on June 19, 2013, 02:32:51 pm
If you fill the bottom most layer with transparent tiles, you'll see into the back buffer, which is black. As a rule of thumb only layer 1 and on should have transparent tiles. As far as your description goes, Sphere can do all that. If you use the older editor and go into the layer properties (by right clicking the layer in the layer list), you can choose for a layer to parallax.
Title: Re: map layers and transparency
Post by: N E O on June 19, 2013, 05:11:56 pm
To build on what Radnen said about the bottom-most layer, there will also be visible tearing in most camera movement if you use transparent tiles in that layer.
Title: Re: map layers and transparency
Post by: DaVince on June 19, 2013, 05:42:24 pm
If transparency reached all the way to your bottom layer, you're going to be seeing a mess - things might be black, as Radnen suggested, but they could as well be whatever was displayed the frame before (like a previous map, or the map's picture before any scrolling happens). So make sure your bottom most layer is always filled with opaque tiles.

That said, you can fill the bottom-most layer with a semi-transparent tile, and the opaqueness of said tile will fade away that mess I just mentioned. You can get some crazy effects like that, but it would really have to be a conscious choice (like if you were trying to make some Yume Nikki type game or something).
Title: Re: map layers and transparency
Post by: ninjasword on June 19, 2013, 06:21:08 pm
i guess wat was happening was i was having troubles with the tileset.... when i was testing stuff out i forgot to save the new tiles... it was causing a crash
Title: Re: map layers and transparency
Post by: Radnen on June 19, 2013, 08:56:39 pm
Oh in that case you should almost always use my new editor. It always saves tilesets separately to stop that from happening.