2

I'm looking to keep my mouse events in sync with my objects after resizing the screen.
I'm told I need to create a data structure to keep track of:

  • Resizing events

  • New coordinates to match the resize

How can I accomplish this using simple algebraic equations and integrate it into a resize event for accurate updating?

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
  • 1
    *"'m told I need to create a data structure to keep track of [...]"* - Who told you that? Do it the other way around create a virtual game map, scale to the size of the window when drawing the scene and scale to the size of the virtual map when receiving an event. – Rabbid76 Mar 18 '21 at 07:21

1 Answers1

1

Do it the other way around create a virtual game map, scale to the size of the window when drawing the scene and scale to the size of the virtual map when receiving an event.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174