- Home /
Nested Canvas - Text not PixelPerfect
Hi, I have a Combobox, which i need to be on top of my other UI elements. I achieved this by using a nested Canvas with Override Sorting checked. Howerver, the text inside my Combobox-Items is not Pixel Perfect, no matter what option i choose there.
Look at my example screenshots. The text is not sharp (even if you can't really see it, trust me, it isn't), and it doesn't change at all, when switching the Pixel Perfect options. The frame of each list item on the other hand, is affect by the Pixel Perfect stuff.
This leads me to the conclusion that Nested Canvases, Pixel Perfect and Texts are not working togehter, which is a bug. I'm using v.5.0.2f1 btw. Can someone confirm this or, if there is a solution, help me out?
Cheers
After filing a bug report and no answer of unity whatsoever, i'll bump this up once more. I tried to reproduce the issue and it's so easy to do. I can't believe i'm the only one having this issue.
Here is what i did: - New Scene with orthographic camera and a canvas using this camera, sorting layer set to 'UI', a custom one, pixel perfect on. - Button inside the canvas, perfectly sharp, no issue - Nested canvas inside the button, sorting layer to override using a custom one, 'UI_Front', which is rendered on top of 'UI'. Pixel perfect inherited - Button inside nested canvas, blurred like hell, sometimes depending on the resolution
Here is a screenshot of my setup:
Please Unity, fix this issue...
Answer by Shark-Boy · Jun 17, 2015 at 03:47 PM
A nested Canvas will mess up a lot of stuff (as I found out the hard way). However there is a way to make a UI element be drawn on top of the other UI elements (as I also found out the hard way) the UI elements are drawn in the order that they are in the hierarchy from top to bottom so if you make your combobox the first gameobject on your canvas it should be on top of everything else. And this should make the pixel perfect work.
And I can't believe that this has been unanswered since $$anonymous$$ay 29?!
What you are saying is partly correct. UI elements will be drawn top to bottom, if i wanted my combobox to be on top, i would need it to be the last sibling in the hiararchy (at the bottom), in order for it to be drawn last. In my case however, this is not possible. I need the combobox to be exactly where it is in the hierarchy, because of resolution scaling reasons.
I guess Unity didn't think of this originally, then introduced nested canvases, because they realized sorting and anchoring/scaling wouldn't work like that, entirely hierarchy dependent.
We tried several methods, e.g. taking the combobobx and shuffling it via script at the bottom of the hierarchy, shuffling it under a seperate 'on top' canvas, etc. Everything ended is some kind of fuck up or mess sooner or later.
So all i need is for Unity to fix their nested canvases-pixel-perfect behaviour with texts.
Anyway, thank you for your efforts! ...and you are totally right, i can't believe it either :(
Your answer
![](https://koobas.hobune.stream/wayback/20220613200337im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Canvas Text gets garbled 0 Answers
New Unity UI with OnTriggerStay. 0 Answers
UI Text Component being reset on player when built 0 Answers
Text object can't be searched for with GameObject.Find 3 Answers
Need Text to Display After 5 Seconds 1 Answer