- Home /
Render sprite on sprite ignoring alpha?
Hi,
Is it possible to render a sprite above another sprite but not it's alpha? What I am trying to achieve is this:
When I put the left image over the middle image, I want it to be rendered above the black, but keep the gaps/alpha parts. It there any way to do this?
Any help is greatly appreciated, thanks.
Answer by Twistorian · Sep 21, 2017 at 12:06 AM
I can think of one way to achieve this.
In this situation, you have two sprites. How about making a third one?
So, from the sprite on the right-hand create two separate sprites: one with the black circle and one with only the three white rectangles.
Construct the original image by putting the two sprites on the same game object.
Then, draw the three of them on top of each other and use Sorting Layers and Order in Layer to draw them in the right order.
E.g. Have done the sprites. Then add all three sprites in the same Sorting Layer in the SpriteRenderer. Then give the white rectangles an order of 2, red thingy an order of 1 and the black circle an order of 0 (or equivalent, in that order of magnitude).
You could also use different Sorting Layers, but this works in the same layer.
Sorry for answering an old topic, but it was sadly previously unanswered.
Your answer
Follow this Question
Related Questions
Sprite rendering problem 0 Answers
Render 2 sprites using one GameObject Unity2D 2 Answers
Making transparent sprite render as quad 1 Answer
Rendering using the Transparent queue 1 Answer
Character sprite rendering order 4 Answers