Skip to content
GitLab
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • Solarus Games Solarus Games
  • SolarusSolarus
  • Issues
  • #734

sol.input.get_mouse_position ignores the window zoom factor

Created by: Maxs1789

the events on_mouse_pressed() and on_mouse_release() take into account the window zoom factor but not the function sol.input.get_mouse_position().

example:

function menu:on_mouse_pressed(button, x, y)
  print("mouse pressed!")
  print("  event:", x, y)
  print("  sol.input:", sol.input.get_mouse_position())
end

outputs (with zoom factor of 2 and a quest size of 320x240):

mouse pressed!
  event:        23      17
  sol.input:    46      34
mouse pressed!
  event:        134     55
  sol.input:    268     110
mouse pressed!
  event:        176     131
  sol.input:    nil
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking