Zoom: Preserve Mouse-on-Land even if We'll See Void

Started by Simon, November 13, 2024, 09:28:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

I've toyed with the zoom behavior in Lix 0.10.26.

Existing rule from Lix 0.9 and Lix 0.10: Generally, preserve mouse-on-land when you zoom. But if you can move the camera to see more land (and less void, i.e., less of the dead area outside the level boundaries), always prefer to shift more land into view over preserving mouse-on-land.

Experimental rule A: Generally (and more often than before), preserve mouse-on-land when you zoom. Only shift more land into view if the camera would center on a void pixel after the zoom. Or, worded in a different way: Eventually, we still shift land into view, but the camera will allow some void (up to 50 % each of left/right/top/bottom may be void) before the camera prefers more land.

Bonus effect of rule A: When we zoom in, we zoom into the mouse cursor, which enlargens (or at least keeps the same amount of) the land on all four sides of the mouse cursor. This can never run into the situation where rule A wants to shift more land into view. (Only zooming out can shift more land into view.)

Downsides of rule A: When we zoom out, the land isn't necessarily anchored at the panel at the bottom any more. I can try to change the rules and re-anchor, but it will come at the cost of less mouse-on-land preservation.

See it animated


Both of these gifs are under this experimental rule A.

  • In the 1st gif, the zoom preserves the mouse-on-land completely.
  • In the 2nd gif, the mouse is close to the corner of the screen. Here, preserving mouse-on-land would eventually shift too much void into view, and rule A tells us to move the camera to avoid more than 50 % void at the left side of the screen. (This can only happen when we zoom out, never when we zoom in.)

Test it yourself: Put lix-0.10.26-halfvoid-camera.exe into your 0.10.26 tree, or build branch camera from my unstable repo. Either way, you'll get experimental rule A.

What do you think? Is this useful or annoying?

Do you want to allow even more void, to preserve mouse-on-land even more often?

When you zoom out so that we could re-focus the camera to show the entire level at once, should we refocus (instead of preserving mouse-on-land) to show the entire level? Or do you prefer to scroll yourself to see it all?

-- Simon