Converting screen space to rectTransform space
I want to create a Rect as selection box for cropping a texture. I have the selection box in screen space, but the texture's position is in it's rectTransform space (an Image on Canvas in GUI).
The Canvas: - Rendere Mode: Screen space - Camera Plane - Distance: 10
How do I convert both the position and the size of my Rect (selection box) to texture space?
I want the converted coordinates to be (0, 0) on the top left corner of the texture and (width, height of the texture) at the bottom right.
The screen size is 1080 x 1920 The texture.GetComponent().position = (0, 0.4, 0) The texture.GetComponent().sizeDelta = (666, 1052)
Your answer
Follow this Question
Related Questions
How can I replace this code? 0 Answers
Unity 2017.1 p4 - Unity Screen-space camera canvas - Graphics Raycaster fails 1 Answer
Convert Screen point to UI rectangle coordinates 2 Answers
rect transform, dont chance with the new version 5.3.4? 0 Answers
I want to create a game type Crash Bandicoot (I need help) 3 Answers