[SOLVED] How to get a list of values for settings. like the screen resolution values list in startup of the Jme game?

how to get a list of values for settings. like the screen resolution values list in the startup of the Jme game?
and the list of values for the color Depth and anti-aliasing?

Simply monkey out the jME dialog?

2 Likes

I mean, I guess you have disabled that and want to build your own? If I misunderstood, just enable the default one and those things get prompted when your app is started.

1 Like

no, I want to show it in the internal window and change settings in-game not in the start-up of the game.

1 Like

Open JME code.
See how that code does it.

3 Likes

I think you cannot do that , you need to exit the game , change them & re-enter it because these settings control the rendering ,but there are chances to get & set them easily when you out of the game

EDIT : you can attach those sets in a separate gui class

1 Like

No, this is wrong. You can change these settings while playing the game just like in any other “standard” game.

As pspeed said… look at the code how jme does it

3 Likes

JME doesn’t have an example of restarting with new settings I think (maybe it does).

It’s straight forward, though. Set new app settings and then restart the context.

1 Like

I guess @jayfella had a utility library for easing in-game modification but seems GitHub page is not available?
Looks like Bintray link is still working though.

2 Likes

In a LegacyApplication, all these settings are stored in a com.jme3.system.AppSettings instance that’s accessible via the application’s (protected) settings field.

The values for color depth can be obtained (for full-screen modes) from AWT. Here’s how I build the color depth menu for Maud:

        if (displaySettings.isFullscreen()) {
            int height = displaySettings.height();
            int width = displaySettings.width();
            GraphicsEnvironment environment
                    = GraphicsEnvironment.getLocalGraphicsEnvironment();
            GraphicsDevice device = environment.getDefaultScreenDevice();
            DisplayMode[] modes = device.getDisplayModes();
            for (DisplayMode mode : modes) {
                int modeDepth = mode.getBitDepth();
                int modeHeight = mode.getHeight();
                int modeWidth = mode.getWidth();
                if (modeDepth >= 16 && modeDepth != depth
                        && modeHeight == height && modeWidth == width) {
                    String modeItem = Integer.toString(modeDepth);
                    if (!builder.hasItem(modeItem)) {
                        builder.add(modeItem);
                    }
                }
            }

And here’s how I build the anti-aliasing menu:

        for (int factor : new int[]{1, 2, 4, 6, 8, 16}) {
            if (factor != selectedFactor) {
                String description = describeMsaaFactor(factor);
                builder.add(description);
            }
        }
1 Like