diff --git a/examples/core/core_window_letterbox.c b/examples/core/core_window_letterbox.c index 4402dd2a..f28f2a5f 100644 --- a/examples/core/core_window_letterbox.c +++ b/examples/core/core_window_letterbox.c @@ -71,6 +71,11 @@ int main(void) virtualMouse.x = (mouse.x - (GetScreenWidth() - (gameScreenWidth*scale))*0.5f)/scale; virtualMouse.y = (mouse.y - (GetScreenHeight() - (gameScreenHeight*scale))*0.5f)/scale; virtualMouse = ClampValue(virtualMouse, (Vector2){ 0, 0 }, (Vector2){ gameScreenWidth, gameScreenHeight }); + + // Apply the same transformation as the virtual mouse to the real mouse, to work with raygui. + // SetMouseOffset(-(GetScreenWidth() - (gameScreenWidth * scale)) * 0.5f, -(GetScreenHeight() - (gameScreenHeight * scale)) * 0.5f); + // SetMouseScale(1 / scale, 1 / scale); + //---------------------------------------------------------------------------------- // Draw