How can I get the width and height or the x and y position of a widget? #1138
Answered
by
eugineerd
LaBatata101
asked this question in
Q&A
-
didn't find anything in the docs, is this possible? |
Beta Was this translation helpful? Give feedback.
Answered by
eugineerd
Jan 20, 2022
Replies: 1 comment 1 reply
-
Use the let label_response = ui.label("Text");
let label_height = label_response.rect.height();
let label_pos = label_response.rect.left_top(); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
LaBatata101
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the
rect
field of aResponse
returned from adding a widget to the ui.