windows 10 - Gamemaker Mobile device Inconsistent Drag Speed Across Different Operating Systems (Win7 vs. Win10) - Stack Overflo

时间: 2025-01-06 admin 业界

I'm developing a game in GameMaker Studio 2 where I implemented touch-based object dragging functionality. The code works as expected on Windows 7, but when testing on Windows 10, the dragging speed is significantly slower, even though the same code is used on both systems. Here's the code for object drag:

// Create Event
dragging = false;
drag_offset_x = 0;
drag_offset_y = 0;

// Mouse Down Event
if (mouse_check_button_pressed(mb_left)) {
    dragging = true;
    drag_offset_x = mouse_x - x;
    drag_offset_y = mouse_y - y;
}

// Mouse Up Event
if (mouse_check_button_released(mb_left)) {
    dragging = false;
}

// Step Event
if (dragging) {
    x = mouse_x - drag_offset_x;
    y = mouse_y - drag_offset_y;
}