Assuming we’re considering UI elements nested under a screen-space overlay canvas. Is there a universal method of getting the exact dimensions of an element E in pixels?
Please consider all the possible cases:
- All possible anchor settings
- All possible pivot settings
- Elements that are children of a
layout group - Elements that contain content size
fitters - The Canvas has different UI scale modes
I’ve tried all the built in methods/variables with RectTransform and none of them seem to work for all cases. Is there an easy method to get the pixel dimensions?