Problem with UI not being absolute values


I’m running into a problem where the UI system won’t respect pixel sizes.
The below picture is a white box, with a layout group spreading identical 2px wide lines across the box. As shown in the picture the lines are not looking alike altho its clones of each other. Is there a fix for this?


Hmm that seems like a filtering issue? I’m not sure, @yaustar any idea?

Hmm that sounds right, hopefully Yaustar has some way to fix it :slight_smile:

How are the anchors?

The layoutgroup is 0.5 across the board, and the lines are 0 across the board

Unless it’s 1 to 1 pixel ratio the the monitor and resolution, it’s never going to be perfect unfortunately

1 Like

I would put the lines as a child of the white line and the anchorages of each line in relation to how long you want it to be and it should be maintained in all screen sizes.

That’s to bad :frowning: But you can even get into a situation where an object is not shown if the width is to low, that can’t be the intended way to scale the UI to the screen?

That is more or less what I’m doing. But I’ll switch to another implementation.

There’s going to be cases where whatever is being rendered is going to be smaller than a pixel be position between ‘pixels’.

If you have a repro, I may be able to take a quick look but I’m not sure there is much that can be done

1 Like

That’s fair, the implementation is currently fairly deep in the project. I’ll make a blank project when I get the time.

I just hoped there was some way to make the size of an object absolute.

Thanks for the help :slight_smile:

1 Like