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

Add an option to set the rendering size of Game View windows #515

Closed
YMRYMR opened this Issue Mar 30, 2017 · 7 comments

Comments

2 participants
@YMRYMR
Contributor

YMRYMR commented Mar 30, 2017

Summary

It would be useful to have an option to set the size of undocked view windows to see the real result when the external view is a camera.

Analysis

  • This feature would be useful to test different resolutions in the editor.
  • It could be added in the view toolbar (see attached mockup).

Attachments

undockedviewsize

@ilexp ilexp added this to the v3.0 milestone Mar 30, 2017

@ilexp ilexp changed the title from Add an option to set the size of undocked view windows to Add an option to set the rendering size of Game View windows Mar 30, 2017

@ilexp

This comment has been minimized.

Member

ilexp commented Mar 30, 2017

Sounds like a useful thing to have, though I would suggest to directly override the rendering size instead of the window size, as this would work both for docked and undocked windows. With this in mind, it's clearly a v3.0 branch issue as the required rendering changes are already available there.

@ilexp

This comment has been minimized.

Member

ilexp commented Jun 21, 2017

Progress

  • Investigated the rendering side of this and so far it looks like it should be doable without too much effort.
  • Started working on this in the develop-3.0-gameviewsize-wip branch.
  • The Game View now spawns a custom toolbar, like RigidBody Editor and Tilemap Editor do. In the WiP version, it only consists of the two (non-functional) size text boxes, to be extended.

Immediate ToDo

  • Consider changing behavior to, instead of locking all the CamView controls, hiding them, and using the already existing main toolbar for the size textboxes. Saves some vertical space, which would be really neat. The added toolbar feels somewhat bulky and unnecessary so far.
  • Update textboxes based on window size changes.
  • Validate textbox input and, when invalid, reset on losing focus.
  • Apply textbox values to actual rendering output size.
    • Handle scale-up and scale-down separately
    • Scale-down: Just set the viewport size and center it in the available area.
    • Scale-up: Render to an internal RenderTarget and do a fitted blit into the actual view.
  • Add a dropdown button to allow selecting a preset.
    • Game view size
    • Target size from DefaultUserData
  • Serialize the output size setting to editor user data.

@ilexp ilexp self-assigned this Jun 21, 2017

@ilexp

This comment has been minimized.

Member

ilexp commented Jun 23, 2017

Progress

  • Replaced the additional toolbar with occupying right-hand side space on the camera / editing toolbar that is unused in the Game View anyway.
  • Textboxes now adjust to window size changes and parse values when entered.

Immediate ToDo

  • Validate textbox input and, when invalid, reset on losing focus.
  • Apply textbox values to actual rendering output size.
    • Handle scale-up and scale-down separately
    • Scale-down: Just set the viewport size and center it in the available area.
    • Scale-up: Render to an internal RenderTarget and do a fitted blit into the actual view.
  • Add a dropdown button to allow selecting a preset.
    • Game view size
    • Target size from DefaultUserData
  • Serialize the output size setting to editor user data.
  • Write lots of comments and XML docs for API, event if non-public where it makes sense.
@ilexp

This comment has been minimized.

Member

ilexp commented Jun 25, 2017

Progress

  • Target size textbox input validation, reset and overall behavior improved.
  • Target size is now actually applied to the rendering output, using a RenderTarget for sizes bigger than the game view client area and rendering directly otherwise.
  • Added a game view background, so there is a visual difference between an area that is not rendered to at all, and one that would be part of a game window with that size, but happens to be black.
  • Added support for DualityApp, RenderSetup, Scene and Camera output render targets that are not the backbuffer, fixed internal viewport scaling bugs along the way.
  • Fixed a RenderSetup bug that would produce an invalid Y coordinate axis in screen space rendering when image size and viewport size weren't equal.
  • Implemented an input re-mapping for mouse coordinates when the game view window size is not equal to the simulated game window size.

Immediate ToDo

  • Add a button to reset to game view size. A dropdown menu allows to specify presets:
    • Game view size
    • Target size from DefaultUserData
    • A list of common resolutions?
    • A list of frequently used resolutions?
  • Serialize the output size setting to editor user data.
  • Write lots of comments and XML docs for API, event if non-public where it makes sense.
  • Merge back to develop-3.0.
@ilexp

This comment has been minimized.

Member

ilexp commented Jun 27, 2017

Progress

  • Added a preset selection menu for rendering resolutions, including dynamic presets (game view, target size) and fixed presets (a set of common or useful resolutions).

Immediate ToDo

  • Serialize the output size setting to editor user data.
  • Determine recently used resolutions.
  • Add the three most recently used resolutions to the preset list.
  • Write lots of comments and XML docs for API, event if non-public where it makes sense.
  • Merge back to develop-3.0.
@ilexp

This comment has been minimized.

Member

ilexp commented Jul 1, 2017

Progress

  • Serialization of settings to EditorUserData.
  • Recently used resolutions in the preset list dropdown.

Immediate ToDo

  • Write lots of comments and XML docs for API, even if non-public where it makes sense.
  • Merge back to develop-3.0.
@ilexp

This comment has been minimized.

Member

ilexp commented Jul 2, 2017

Done.

@ilexp ilexp closed this Jul 2, 2017

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