Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should the Zoom feature work for Game Screens? #125

Closed
Nancy-Salpepi opened this issue Apr 15, 2024 · 3 comments
Closed

How should the Zoom feature work for Game Screens? #125

Nancy-Salpepi opened this issue Apr 15, 2024 · 3 comments
Assignees

Comments

@Nancy-Salpepi
Copy link

While testing phetsims/qa#1066 and phetsims/qa#1067, I noticed that when zoomed in on the Game Screen, selecting a level doesn't return the zoom to the default setting. Wondering if the behavior should be the same as what occurs when switching screens? Typically if I zoom in on a screen and then switch screens, I will no longer be zoomed in.
In the attached video, I end up not seeing anything but a yellow screen because I am zoomed in on a spot that has no elements.

Steps:

  1. In graphing lines, select the Line Game screen
  2. Zoom in
  3. Select a level
GameScreenZoom.mp4
@jessegreenberg
Copy link
Contributor

jessegreenberg commented Apr 16, 2024

Thanks @Nancy-Salpepi. I can't decide on whether we should do this and want to run it by others. We do this when changing screens so that

  1. The user has an overview of the new screen.
  2. Better panning when the screen changes. The pan/zoom listener pans to put the focused Node in the center of the viewport. When changing screens, focus is placed on the ScreenView. So if don't zoom out, changing screens would pan to the center of the ScreenView.

These arguments probably apply to the level select buttons. But there may be reasons not to, like

  • Does this set the precedent that we zoom out every scene change? (hopefully not)
  • Are these level select buttons in common code so that the zoom out can be done in one place? If not this could be harder to support.

If you do want to zoom out, it can be done like this:

animatedPanZoomSingleton.listener.resetTransform();

@jessegreenberg jessegreenberg removed their assignment Apr 16, 2024
@pixelzoom
Copy link
Contributor

pixelzoom commented Apr 16, 2024

My opinon is that we should NOT make any change. We should reset the zoom transform (zoom to 100%) only for screen changes, and not for changes within screens. Which means NOT for returning to the Level Selection buttons. Doing so for the Level Selection buttons becomes a slippery slope. First, it feels presumptious. Second, will we start resetting zoom whenever the UI significantly changes? And have to continually discuss when to do so? This happens with scenes, difference game challenges, ... There's also nothing in vegas that would handle this automatically; each sim would need to handle it -- and remember to address it in future sims.

If you do decided to proceed with this... I'm going to consider this non-blocking for phetsims/graphing-lines#142 (Graphing Lines 1.4). There are many other sims with Games that would require an MR, and Graphing Lines will be one of them.

@pixelzoom pixelzoom removed their assignment Apr 16, 2024
@amanda-phet
Copy link

I think @Nancy-Salpepi 's video does show a downside to not resetting the zoom, but agree with @pixelzoom and @jessegreenberg that we'll run into many edge cases like this, such as switching scenes, showing dialog buttons, and other examples we can't think of right now, so I think we should not proceed with this kind of behavior for zooming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants