Make the crosshair hit where the mouse points when the game is scaled
Shots land beside the cursor as soon as the game window is stretched, centred in a larger page or shown with black bars. The mouse reports positions on the page, not inside the game. This entry converts them correctly and tells you when the cursor is on the bars.
Why this works
The mouse and the game speak different coordinates: one counts from the page, the other from the picture. Aiming works once you undo, in reverse order, exactly what was done to the picture: move it, add bars, enlarge it. Then the same spot means the same spot.
When not to use it
Skip it when the game is steered by keys or a gamepad and the mouse only clicks big buttons: a page-level click is enough there. Also skip it if the game fills the page at exactly its own size, with nothing scaled.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 20 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Make the crosshair hit where the mouse points when the game is scaled" (read_entry action-mouse-aim-scaled-canvas) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP