Hello Guest

Author Topic: Tilemap layer opacity  (Read 5522 times)

biggo

  • Newbie
  • *
  • Posts: 7
    • View Profile
Tilemap layer opacity
« 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? ???

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap layer opacity
« Reply #1 on: September 18, 2014, 10:15:23 am »
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.

biggo

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap layer opacity
« Reply #2 on: September 18, 2014, 11:36:36 am »
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?



« Last Edit: September 18, 2014, 08:12:06 pm by biggo »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap layer opacity
« Reply #3 on: September 19, 2014, 02:54:26 pm »
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.

biggo

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Tilemap layer opacity
« Reply #4 on: September 19, 2014, 07:02:59 pm »
Awesome! That works perfectly - thanks a lot! :D