- Home /
How to get the width of the line in pixels?
I am working on a project where you have to draw anything using a LineRenderer Component and then I process your drawing using the positions of the Line. To get the positions is pretty simple, but I need to know which width of the line you choose in game. Here is an example:
As you can see, I've done a simple drawing, but the width of the line will be chosen by the player. Now, for this drawing I've used the Width of 0.15 for the LineRenderer Component: Now, what I have trouble with, is how can I get the width of the Line in pixels. Let's say that the White Image is 900x900 pixels. In this case, how can I get the width of the line in pixels relative to the width of the RawImage used as a Background to draw on top of? Thank you in advance.
Your answer
![](https://koobas.hobune.stream/wayback/20220613004510im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I make a line render always be pointing at the center of the canvas/gui 1 Answer
Unity C#: Line renderer from Gameobject (3D) to Canvas (Screen Space - Camera) 1 Answer
How to make UI circle follow UI Line Renderer 0 Answers
LineRender width not consistent across resolutions 1 Answer
Drawing a line in a sprite 0 Answers