[SUGGESTION] [EDITOR] [ADDED] Zoom into the Center

Started by Nepster, February 05, 2016, 11:00:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nepster

Status: Implemented for next update.

Nepster

Unless some terrain piece/object is selected, the visible area jumps wildy when zooming in or out. To me the current algorithm is very mysterious - I wouldn't even be surprised if the new position is completely random ;P.
It would be much more natural to zoom into the center of the currently visible area instead.

namida

#2
It would appear it zooms in on wherever the mouse cursor is. I'll look into whether this can be changed to your suggestion.

EDIT: I'm not really noticing any way within the current setup how I can find what would be the current on-screen position, so I don't think I'll be able to implement this change. I'll keep it open in case I think of something in the future.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Nepster

Two ideas:
1) If you add a terrain piece, this is added where you clicked on the screen. So the terrain addition algorithm should contain some code to determine the current screen position.
2) The position of the scroll bars should be kept somewhere and from this the screen position should be computable. Hopefully some code for this is already written where the scroll bar functions are encoded.
Of course there is still the problem to recognize these code parts...

namida

I already considered the scroll bars, and while I could get some details from them, I couldn't spot any obvious way to deduce the position. When I tried, it always seemed to just zoom into the furthest-right part of the level (unless a terrain piece was selected).

I believe the terrain piece placing - just like many other stuff - first converts the current mouse position (in absolute terms) to the position on the bitmap image (similar to in a paint program, how if you hover your mouse over a pixel then look at the mouse position shown near the bottom, it doesn't show the absolute position, but rather the pixel coordinates within the image). This is also how zoom currently works when nothing's selected - it zooms in on the mouse position. This wouldn't offer any existing benefit, as far as I can tell.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

mobius

I think it's just fine the way it is= being able to zoom in anywhere; where you have the cursor is really nice. Actually I might prefer it if it's always this way, verses always centering in on the piece currently selected.
everything by me: https://www.lemmingsforums.net/index.php?topic=5982.msg96035#msg96035

"Not knowing how near the truth is, we seek it far away."
-Hakuin Ekaku

"I have seen a heap of trouble in my life, and most of it has never come to pass" - Mark Twain


namida

Hm... it might be nice, but it's also very non-standard...

Anyway, I think I may have found a way to do this at last. :) Still working out the exact calculation, but I found some properties that may actually be useful for implementing this.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

#7
FINALLY! I managed to do this. :)

I'll have it in for the next update. But it looks like this is another thing that should be user-configurable.

EDIT: I've put 4 options:

1. Zoom on selection if any; or otherwise on center of current view (new default)
2. Zoom on selection if any; or otherwise on mouse position (current behaviour)
3. Zoom on center of current view
4. Zoom on mouse position
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)