Publishing on Linux... Yes or No?

Will try scaling them then.



What about a)? How do I check that? DisplaySystem.getAdapters().getResoutions() wasn’t accepted.

@memonick said:
What about a)? How do I check that? DisplaySystem.getAdapters().getResoutions() wasn't accepted.

..like I said its in the SettingsDialog class.
[java]GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
modes = device.getDisplayModes();
[/java]
1 Like

If I use the normal settings that show in the beginning, would I still need to check whether the resolution is supported in full screen?

So if I use the following code, I would be checking if the display supports 1024X768, and setting it to 1024X768 if it does, else it lets the user choose? Is that right?



[java]boolean found = false;

GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

DisplayMode modes[] = device.getDisplayModes();

for (int i=0; i < modes.length; i++){

//System.out.println(modes.getHeight() + "," + modes.getWidth() + "," + modes.getBitDepth() + "," + modes.getRefreshRate());

if ((modes.getHeight() == 768) && (modes.getWidth() == 1024)){

AppSettings settings=new AppSettings(true);

settings.setFullscreen(true);

settings.setHeight(768);

settings.setWidth(1024);

settings.setFrameRate(60);

Main.app.setSettings(settings);

Main.app.setShowSettings(false);

found = true;

}

}

if (!found) {

Main.app.setShowSettings(true);

}[/java]

If the display doesn’t support 1024x768 on a Mac, they need a new Mac anyway :stuck_out_tongue:



Really you should not hard code display resolutions anyway, just let people choose it in the launcher so they can pick one that’s right for them. With modern displays its important to run at the native resolution in full screen, which differs between displays, so there’s no way you can 2nd guess it.

1 Like

Will do that then.

Thanks a lot both of you :slight_smile: The game runs very well - regardless of what setting I choose.



@normen I am doing what you said, aren’t I?

@monkeychops said:
If the display doesn't support 1024x768 on a Mac, they need a new Mac anyway :P

1024x768 means 4:3, no mac with a 4:3 display ratio exists, normal is 16:10 for macs

The best method you have is listening to @normen and verify before if the current OS can run full screen, and make a simple algorithm to calculate possible resolutions. Don’t force just 1.

I think I am going to let the user choose - seeing as the system I was using before can work on any resolution.



@normen, is this right?

Yeah, just use the normal settings display or let the user choose from the compiled list of available resolutions by other means. Then make your game resolution independent (!)

What do you mean by independent? Make the game run well on all resolutions?

Yeah, if your stuff works with 1024x768 now, just scale the mouse clicks or whatever from other resolutions or at best make it work with percent or smth.

@memonick said:
I need to update jME for it to work? I tested using BitmapFonts and the fonts didn't scale.

...Its Nifty...

Oh… sorry :stuck_out_tongue:

@normen said:
Yeah, if your stuff works with 1024x768 now, just scale the mouse clicks or whatever from other resolutions or at best make it work with percent or smth.


That's is specially true for a game. Try to scale your UI or repositioning it, leaving more space for the interactive gameplay screen.

I don’t have to. With a system I worked on during last week-end, any resolution should work well. I’ve already tested eight, and the results are all good.

The only problem currently with resolution independence is fonts (please correct me if I’m mistaken), as they don’t scale, so you might need to use different fonts for different resolutions or use the textSize attribute to scale fonts (not too big though). However, I believe void is working on scalable fonts for Nifty, though I can’t seem to find a reference to that right now.

No, it’s not. Just checked. Shouldn’t be a problem to scale it though. Thanks for your input.

@Tumaini said:
The only problem currently with resolution independence is fonts (please correct me if I'm mistaken), as they don't scale, so you might need to use different fonts for different resolutions or use the textSize attribute to scale fonts (not too big though). However, I believe void is working on scalable fonts for Nifty, though I can't seem to find a reference to that right now.


Regular fonts scale in JME. This was a limitation of Nifty itself but some time back nifty added the ability to scale the whole UI... which makes the most sense in these cases.