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
The Lua call window:setMousePosition(x, y) previously placed the system mouse cursor at the center of the game window.
When starting the game now, the mouse cursor is no longer placed in the center of the game window.
Now it is placed near (but not exactly at) the Y center of the game window, and at either the far left or far right of the entire system window, rather than in the center of the game window based on dividing the game window's user.ini-provided X and Y values by 2.
window:setMousePosition() (which in /phx/src/system/window.rs calls SDL_WarpMouseInWindow(handle, x, y)) is called by /script/States/Application.lua:
as well as by Application:update() when the game window is resized. This Lua code also no longer moves the mouse cursor to the X/Y center of the game window as it once did when the game window is resized.
Is it possible something in the engine changed related to mouse positioning? (Or maybe window:setWindowGrab()?) Setting the system mouse cursor to a new shape still seems to work, just not setting the system mouse position.
Note 1: The round cursor you see when flying the ship in flight mode gets its position from the yaw() and pitch() functions, not from any call to get the current mouse position. So it still works.
Note 2: Interestingly, clicking on buttons still works. Whatever is reading the mouse position when a click event occurs is getting the correct X, Y position within the game window, since we can see that when you click some button under the system mouse cursor, the correct button gets activated. It's just setting the mouse position programmatically that seems to have stopped working.
Note 3: There is one other different kind of call to set the mouse position, which is Input:SetMousePosition(x, y) as used in HUD.lua. This uses SDL_GetMouseState(&x, &y) (defined in /phx/src/input/mouse.rs) to set the mouse X and Y position within the current window. This may not be working, either. Input.GetMousePosition() returns an x and y value, but they are always both 0. Oddly, there is no window:getMousePosition() function defined in window.rs to go along with the window:setMousePosition() function.
The text was updated successfully, but these errors were encountered:
The Lua call
window:setMousePosition(x, y)
previously placed the system mouse cursor at the center of the game window.When starting the game now, the mouse cursor is no longer placed in the center of the game window.
Now it is placed near (but not exactly at) the Y center of the game window, and at either the far left or far right of the entire system window, rather than in the center of the game window based on dividing the game window's user.ini-provided X and Y values by 2.
window:setMousePosition()
(which in /phx/src/system/window.rs callsSDL_WarpMouseInWindow(handle, x, y)
) is called by /script/States/Application.lua:as well as by
Application:update()
when the game window is resized. This Lua code also no longer moves the mouse cursor to the X/Y center of the game window as it once did when the game window is resized.Is it possible something in the engine changed related to mouse positioning? (Or maybe
window:setWindowGrab()
?) Setting the system mouse cursor to a new shape still seems to work, just not setting the system mouse position.Note 1: The round cursor you see when flying the ship in flight mode gets its position from the yaw() and pitch() functions, not from any call to get the current mouse position. So it still works.
Note 2: Interestingly, clicking on buttons still works. Whatever is reading the mouse position when a click event occurs is getting the correct X, Y position within the game window, since we can see that when you click some button under the system mouse cursor, the correct button gets activated. It's just setting the mouse position programmatically that seems to have stopped working.
Note 3: There is one other different kind of call to set the mouse position, which is
Input:SetMousePosition(x, y)
as used in HUD.lua. This usesSDL_GetMouseState(&x, &y)
(defined in /phx/src/input/mouse.rs) to set the mouse X and Y position within the current window. This may not be working, either.Input.GetMousePosition()
returns an x and y value, but they are always both 0. Oddly, there is nowindow:getMousePosition()
function defined in window.rs to go along with thewindow:setMousePosition()
function.The text was updated successfully, but these errors were encountered: