How can I draw a backdrop behind map tiles

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Gigglyardo
Slime
Posts: 9
Joined: Sun Aug 16, 2015 1:20 am

How can I draw a backdrop behind map tiles

Post by Gigglyardo »

I want to draw a still backdrop behind the map tiles. I realize the map tiles will have to be transparent in order to see the backdrop behind them. Is this possible?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Hmm, yes, I think this should be possible with a little scripting.

First, map layer 0 is always opaque. Fortunately you can hide it completely, and use map layer 1 as your bottom map layer.

You can load a backdrop slice and the put it underneath the map layers.

I can look up the exact commands to do this layer when I am not typing from my phone
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7660
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Okay! Here we go!

Here is the command to hide map layer 0

Code: Select all

variable(sl)
sl := lookup slice(sl:map layer0)
set slice visible(sl, false)
And here is the code that loads a backdrop, and places it underneath the map layers:

Code: Select all

variable(backdrop, maproot)
backdrop := load backdrop sprite(0)
maproot := lookup slice(sl:maproot)
move slice below(backdrop, maproot)
This should work, but I haven't tested it yet, so let me know if you have any problems.

The backdrop will not be automatically removed even when you switch maps, so you might need to use the "free slice" command on it yourself.
Post Reply