2D Toolkit Forum
2D Toolkit => Support => Topic started by: biggo on September 18, 2014, 06:42:34 am
-
Hi there! :)
Is it possible to control the opacity of a layer in a tilemap? At certain parts in my game, I need to make a wall invisible - thus having it "fade away".
Can this be accomplished somehow? ???
-
Not directly, but if you use a different sprite collection / set of sprites per layer, you can override the the material to use use one with a tint parameter which you can tint to fade an entire layer.
-
Not directly, but if you use a different sprite collection / set of sprites per layer, you can override the the material to use use one with a tint parameter which you can tint to fade an entire layer.
I'm not sure what you mean by overriding the material? Could you elaborate a bit?
Also, how can I use a different sprite collection per layer? I don't understand how that can be accomplished?
-
I don't know how you've got your sprites set up. If each layer has unique sprites, then you can override materials for those sprites (http://2dtoolkit.com/docs/latest/tutorial/multiple_materials_in_a_sprite_collection.html) and then change the opacity on the material. You will obviously need a material that does that, the default tk2dsprite material doesn't do it but one of the Unity transparent unlit ones will.
-
Awesome! That works perfectly - thanks a lot! :D