- Home /
Screen Coordinates to UI Texture Coordinates
Hi, I'm having trouble from taking the screen coordinates of a UI element and using them to find the equivalent texture coordinates of an image behind.
I have the screen coordinates of a UI Rect Transform by just doing RectTransform.Position, and I have a RawImage below, which is showing a WebCamTexture, which is captured from my device camera.
In order to run GetPixel on the texture to get the colour underneath the UI element, I need the UV/Texture coords, but I have tried everything to convert between Screen to Texture but I've had no luck. Just wondering the best way to do so.
Thanks - let me know if you need to see any code.
the image behind is also a UI element, just to avoid any confusion
Your answer
Follow this Question
Related Questions
How to use On-Screen Buttons in unity 5 {URGENT} 1 Answer
Assigning UV Map to model at runtime 0 Answers
Wrong import of UV from blender 1 Answer
How to change the text in TextMeshPro 1 Answer
GUI in front of 4.6 UI 1 Answer