Git Product home page Git Product logo

Comments (2)

crykn avatar crykn commented on May 9, 2024

Hey @Frosty-J!

In libGDX, we have the likes of public class InputAdapter implements InputProcessor. Would something like this be sensible for libgdx-screenmanager?

The "idiomatic" approach in libgdx-screenmanager would be to define your own Screen class, i.e. MyCoolGameBaseScreen, which extends ManagedScreen and then use that in your Game class as follows:

public class MyCoolGame extends ManagedGame<MyCoolGameBaseScreen, ScreenTransition> {

   // ...

}

This has the advantage that one can add various other useful (game-specific) features to the base screen. But I can see that for most smaller games (and probably for jam games in particular) that is just more boilerplate code. Hence, I think adding a screen adapter makes sense and also aligns the library closer to the way libGDX itself is structured.

I've never used create() (don't see much advantage to it over a constructor)

The create() method has one main advantage: it allows you to defer initializing the screens. This can come in handy if you are using a loading screen to load your assets first (the loading screen can then call ManagedScreen#initializeScreen() which internally calls create()) or when you want to defer loading until the screen is first shown (by default create() is called after the screen is first pushed).

from libgdx-screenmanager.

Frosty-J avatar Frosty-J commented on May 9, 2024

I've kinda lost touch with libGDX as of late, but next time I'll make my own base Screen and see how that goes.

from libgdx-screenmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.