Blend Masks

Blend modes are somewhat similar to effects in that they do alterations to pixels in the gpu.
However they are setup to work with the background so some additional changes may have to be made.
A really cool effect you can do using them is a mask that only shows what the outline of the top object lets through, like in the globe shown above.
This tut will go over how to set that up.

First off you will need to add an additional layer.







On the new layer you will need to change its preferences on APPEARANCE to "Force own texture"











On that layer add an object you want masked. This one uses a tiled background so that we can animate it to look like a spinning globe.

Set that objects Blend mode to "Source in", and place it where you want. Keep in mind where the origin points are.





Then add the mask and make sure its on top.
This one can have its blend mode set to normal.
Note in the source a hierarchy is applied so that the two objects can be moved together easier.

The events:
+ System: Every tick
-> TiledBackground: Set image X offset to TiledBackground.ImageOffsetX-(50×dt)%520
Set the image offset on the tiled bg so that it looks like its spinning.

Find the source here






Comments