You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let size = Vec2::new(window.width(), window.height());
let mut pos = window.cursor_position()? ;
Some(Vec2::new( pos.x, - pos.y ))
}
I use this and then render to the result and it KIND of works but it is offset by a weird ratio related to the window height. The X is good but the Y is totally off. Also i dont understand why I have too inverse the Y. It seems like getting the cursor position is inverted to the rendering of a window but then also skewed by the window height i am just so confused.
The text was updated successfully, but these errors were encountered:
I cant figure out how to get the current mouse position and create a window/widget at the mouse position (like a windows right-click menu).
pub fn get_ui_cursor_position(window: &Window) -> Option {
}
I use this and then render to the result and it KIND of works but it is offset by a weird ratio related to the window height. The X is good but the Y is totally off. Also i dont understand why I have too inverse the Y. It seems like getting the cursor position is inverted to the rendering of a window but then also skewed by the window height i am just so confused.
The text was updated successfully, but these errors were encountered: