Jeffrey Nielson
Member
This code for my software cursor works on PC, PC with the yoyo compiler, and OSX. However, when using the Yoyo compiler and running the game on Mac OS, the mouse cursor is unaffected by display_mouse_set() or window_mouse_set(). As a result of this, in the below code, the mouse is not set to the center of the window and the values designated to move the software cursor are incorrect.
Is this a bug or something I'm not understanding with retina displays?
Is this a bug or something I'm not understanding with retina displays?
Code:
if instance_exists(oSoftwareCursor)
{
if gameplay
{
//GAMEPLAY MODE
//Track mouse pointer movement in window coordinates
var cursorMoveX = window_mouse_get_x() - windowCenterX;
var cursorMoveY = window_mouse_get_y() - windowCenterY;
window_mouse_set(windowCenterX, windowCenterY);
//Move the software cursor in room coordinates
oSoftwareCursor.x += cursorMoveX * scaleWindowToRoom;
oSoftwareCursor.y += cursorMoveY * scaleWindowToRoom;
//Clamp the software cursor to the boundary
oSoftwareCursor.x = clamp(oSoftwareCursor.x, mouseConstrainX1, mouseConstrainX2);
oSoftwareCursor.y = clamp(oSoftwareCursor.y, mouseConstrainY1, mouseConstrainY2);
}
}