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

Change ScreenManager to no longer reuse screen instances. #26

Merged
merged 19 commits into from
Nov 23, 2023

Conversation

crykn
Copy link
Owner

@crykn crykn commented Aug 16, 2023

Change ScreenManager to no longer reuse screen instances. This leads to closer resemblence with libGDX's Game class.

To test these changes, use version c9a1f42d83 for screenmanager and version v0.3.5 for guacamole. The GWT extension was removed, so the GWT dependencies should now look like this:

implementation "com.github.crykn.guacamole:core:$guacamoleVersion:sources"
implementation "com.github.crykn.guacamole:gdx:$guacamoleVersion:sources"
implementation "com.github.crykn.guacamole:gdx-gwt:$guacamoleVersion"
implementation "com.github.crykn.guacamole:gdx-gwt:$guacamoleVersion:sources"
implementation "com.github.crykn:libgdx-screenmanager:$screenManagerVersion:sources"
implementation "com.github.tommyettinger:formic:$formicVersion:sources"

The module file needs to include the following entry:

<inherits name="libgdx_screenmanager" />

Changes

  • Screens & transitions don't have to be registered anymore; ScreenManager#push now takes a ManagedScreen and a ScreenTransition instance as arguments
  • ManagedGame#initialize & ManagedGame#create were removed which should eliminate the confusion around the difference between constructors, #create() and #show(); old code should be put in the constructor or #show()
  • ScreenTransition#reset was removed in favour of ScreenTransition#show and #hide; old code should be put in #show()
  • ShaderTransitions now compile the shader in the constructor; this means that the constructor has to be called on the OpenGL thread
  • Use ScreenManager#setAutoDispose(true, true) if you don't want to reuse your screens and transitions and thus they should be disposed automatically upon #hide()
  • There were extensive improvements to the javadocs to better document a screen's life-cycle
  • Removed the GWT extension

ToDo

closer resemblence with libGDX's Game class. Some of the changes
introduced were:

- Screens & transitions don't have to be registered anymore
- ScreenManager#push now takes a ManagedScreen and a ScreenTransition as
arguments
- ManagedGame#initialize & ManagedGame#create were removed which should
remove the confusion around the difference between
constructors, #create() and #show()
- ScreenTransition#reset was removed in favour of ScreenTransition#show
and #hide
- ShaderTransitions now compile the shader in the constructor
- There were extensive improvements to the javadocs to better document
when each method is called
@crykn crykn added type: enhancement Make an existing feature better area: core labels Aug 16, 2023
@crykn crykn marked this pull request as ready for review November 21, 2023 20:06
@crykn crykn linked an issue Nov 22, 2023 that may be closed by this pull request
4 tasks
@crykn crykn merged commit b7513b5 into master Nov 23, 2023
1 check passed
@crykn crykn deleted the create_new_instances branch November 23, 2023 09:41
crykn added a commit that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core type: enhancement Make an existing feature better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the libgdx-screenmanager-gwt extension
1 participant