Author Topic: Highlight effect is drawn behind the background  (Read 240 times)

sviudes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Highlight effect is drawn behind the background
« on: June 26, 2019, 04:54:01 AM »
Why is this happening? The effect is drawn behind the background sprite! Is there a fix for this? (Please see attached gif)


Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4994
    • View Profile
Re: Highlight effect is drawn behind the background
« Reply #1 on: June 27, 2019, 01:27:08 AM »
The other sprite is blocking the effects. Use latest beta (to which you now have access). Latest version includes "Always On Top" options for glow and outline effects, which now is enabled by default.

sviudes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Highlight effect is drawn behind the background
« Reply #2 on: June 27, 2019, 03:44:21 AM »
Thank you. I tried the beta, and it works only when using Default Layer. When using other sorting layers, it doesn't work:

(Please see attached image: highlight-sorting.png)

Also, I'm having another problem:

(Please see attached image: highlight-polygon.gif)

Is it happening because polygon packing is not supported?

(Please see attached image: highlight-atlas.png)

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4994
    • View Profile
Re: Highlight effect is drawn behind the background
« Reply #3 on: June 27, 2019, 04:11:42 AM »
In the first picture: has the second potion icon the Highlight Effect script attached? By default, it enables "See-Through" effect which makes the sprite visible through any other outline or glow effects. Try disabling the See-Through effect in the second potion.

Could you please send me a copy of that sprite using polygon packing? It should work out of the box but this could be a more complex case.
Thanks

sviudes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Highlight effect is drawn behind the background
« Reply #4 on: June 27, 2019, 09:46:15 AM »
The second potion does not have the highlight script. Also this problem is happening in the gif of my previous message, you can see that the outline is drawing behind other sprites, and "Always on top" is checked. It only works when I'm using the "Default" sorting layer. To reproduce it, try assigning different sorting layers to both sprites different than "Default".

I've sent you a private message with the polygon sprite atlas, so you can reproduce the problem. I hope you can fix it, because your Highlight effect is great, but I can't use it :(

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4994
    • View Profile
Re: Highlight effect is drawn behind the background
« Reply #5 on: June 27, 2019, 11:42:46 AM »
The outline and highlight effects will render on top within the sorting layer of the sprite. If you enable glow/outline "Always On Top", it ensures those effects will appear over any other sprite in the same sorting layer. If you put a sprite in a sorting layer in front of it, then nope, the glow/outline won't appear. This is expected. You can move the sprites to a background layer though.
Here's a video showing how the glow effect shows or not depending on the sorting layer: https://youtu.be/ZVNXCC_YCcw

I'm checking your sprite atlas and will get back to you.