Working with masks
A mask layer can help you with masking specific cells from your layer.
A mask layer uses masks behaviours which describes how the layer should be masked.
You can of course modify / paint a mask layer like any other layer by selecting the mask layer.
TileWorldCreator comes with 4 default mask behaviours
(border, inner, circle, random)
You can also add your own mask behaviours by creating a new class file in unity and inherit from TileWorldCreator.
Check out a mask class inside the MaskBehaviours folder to see how a simple mask behaviour is created.
Now let's see how we can add an additional preset and mix it with our map by using a mask.
In this example we will use a second layer to apply a different tileset only for the border of our map.
This is great if you want to add an additional tileset with ramps for example.
- Generate a new map by clicking on generate new.
- Click on the duplicate layer button on the right side of the first layer. This will duplicate our first layer to a second layer.
- Make sure that in the settings you have unchecked the option "Build overlapping tiles"
- Now that we have an exact duplicate of our first layer we will need to assign it with a new preset which will have a different border tile. In this example we will use the ramp tile from the preset_00. So just duplicate the first preset and assign the ramp tile to the first slot of our newly created preset.
- TileWorldCreator adds automatically a Y offset to every layer so we have to compensate that in the newly created preset by setting the block offset Y to: -0.5
- Assign the newly created preset to the second layer.
- Now make sure you have selected the second layer then click on the Add mask button, select in the dropdown field the border mask behaviour and click apply
- That's basically it. By selecting the mask layer you can remove or add cells to the mask.
- Try different mask behaviours by selecting them in the dropdown menu of the mask layer. By clicking apply, the mask layer will be re-builded