6

You need to use the Display class to activate and change resolution of additional displays. You can access the additional displays using Display.display[i], where i is the display index (main = 0, 2nd = 1, etc.). Use Display.display[i].Activate(display_width, display_height, display_refreshRate) to activate the additional displays. Edit: to answer your ...


5

There are multiple points that come into play: Switching from windowed to full-screen mode often involves recreating some rendering / drawing contexts which simply needs some time to do some "administrative" tasks, such as allocating memory. This may also involve finding a matching resolution that works (e. g. see the documentation for this D3D9 method) ...


5

The way I do it, not in java but in some sort of c#/c++ hybrid, is I have an engine class (similar to your main class), which holds a Screen object. The screen object is an abstract class with two main functions, update and draw. The engine has one screen which it just calls the Update and the Draw functions. While I have no experience with it, I imagine ...


4

After trying a few different approaches, I implemented the following, and it's working quite well. Briefly: I have a GameManager class which is responsible for maintaining systems, components and resources. public class GameManager : Disposable { public EntityManager EntityManager { get; private set; } } GameManager is the game's primary interface to ...


3

The nomenclature here is definitely odd. I at first thought you were talking about something lower level (like the scenegraph or screen manager for organizing logic flow and/or rendering). I then realized you are talking about what I would refer to as game state. Scenes are a popular term for it now with Unity, so I could see why you would call it ...


2

Pretty simple, there are two candidate solutions, one where the full width is used and one where the full height is used, you must always pick the smaller of those: widthToUse = Math.min(screenWidth, screenHeight * ratio) heightToUse = Math.min(screenHeight, screenWidth / ratio) offsetX = (screenWidth - widthToUse) / 2 offsetY = (screenHeight - heightToUse) ...


2

You forgot to quote the important part of FN-U2 for your question (emphasis mine): App uses the whole screen in both orientations and does not letterbox to account for orientation changes. Minor letterboxing to compensate for small variations in screen geometry is acceptable. What you're doing here is perfectly fine, since it indeed can be ...


2

Don't initialize everything in show. Consider passing a reference of the parent screen to the child screen along with a reference to your Game instance when creating new screens. That way the child screen has a way to get back to an already initialized version of the parent screen. public class MyLibGdxGame extends Game { @Override public void create () ...


2

I would say that the most time-consuming task that needs to happen in most games is recreating video memory resources (textures, render targets, meshes) in response to a "device lost" event (note that this is specific to Direct3D 9 and earlier). Taken from MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/bb174714%28v=vs.85%29.aspx#Resources ...


2

Not really (or at least if there is a technical term I've never heard it in common use, but maybe somebody who wanders in from the UX StackExchange site can educate me). I've heard them informally referred to with a variety of terms, primarily: non-gameplay screens shell or shell screens menu screens


1

I figured it out. gameTime.ElapsedGameTime is a TimeSpan that refers to the amount of time that has passed since the last update, which is a fraction of a second. By using gameTime.TotalGameTime, I was able to get the total amount of time that has passed since the program started running. Also, for some reason I can't explain, using > in when comparing ...


1

Maybe setscreen causes a device reset, in which case things get properly nullified. Two suggestions: Use windowed mode only, then you can place the window in any screen (and for "fullscreen", use a borderless, captionless window with size = physical full screen dimension, place it at any screen's origin). Render (hidden) everything to a surface first, then ...


1

VirtualBox has a fantastic solution to this problem -- they lock your cursor inside the window, if you press the control key, in my case that's cmd. You have proposed this and I would deffinetly advise for it. An example implementation of this would be, the user clicks on the game window and everything else darkens, to create the illusion of them being in ...


1

Gdx.gl.glClear : as .glClear suggests, this function clears the screen before drawing the next frame. It depends where do you instantiate your font object (as you're using libgdx I guess you use BitmapFont to create your font object). An approach could be to instantiate it in the main class (the one that extends Game), and whenever you want to draw it on ...


1

That's an OK way to do it. The way I do is that I have a ScreenManager which "loads" screens, those screens are implementing the IScreen interface and has different methods like LoadContent, UnloadContent and Initialize. For instance, when I press the PLAY button in the main menu, the ScreenManager's addScreen function runs, sets the oldScreen variable's ...


1

Saving the data on the pause screen is a good point to do so. Additionally you'll want to save your state on application close and on application deactivate, and reload the state on open and activate. These events are exposed in the MonoGame XAML template, but I'm not positive they are exposed on the non-XAML template, but I will check and edit this when I'm ...


1

I run Windows 8.1. Just check Windowed under the Graphics tab in the configuration when the game starts up: If you don't have the startup config dialog. Go to Edit->Project Settings->Player and set Display Resolution Dialog to Enabled: If you do not want to have the config dialog you can set the Screen.fullScreen property to false in code.


Only top voted, non community-wiki answers of a minimum length are eligible