I’ve currently looked through several posts to implement correct resolution and I’m really struggling, for some reason or another I don’t seem to be able to get them to work.
I’m looking for the most absolute simple, straightforward way to scale resolution on Android with the touchpad.
Is there a complete (up to date) foolproof comprehensive post/guide that tells you exactly what to do, step by step?
"The constructor needs to be modified to include the virtual Width/Height paramerters and to resolve the GraphicsDeviceManager from the game.
public ScreenManager(Game game, int virtualWidth, int virtualHeight):base(game)
{
// set the Virtual environment up
this.virtualHeight= virtualHeight;
this.virtualWidth= virtualWidth;
this.graphicsDeviceManager=(GraphicsDeviceManager)game.Services.GetService(typeof(IGraphicsDeviceManager));
// we must set EnabledGestures before we can query for them, but
// we don't assume the game wants to read them.
TouchPanel.EnabledGestures= GestureType.None;
}
"
After adding this I receive the following errors: “Method must have return type” and “Unexpected token ‘:’”
The additional steps also give many errors including “Ambiguity between ‘Game1.Sale’ and ‘Game1.Scale’”
Are there a specific places I need to add the code? I am currently just adding it into my public class Game1 : Game class.
The original problem I am still having is that after I insert this class I receive the following errors:
CS0103 The name ‘ScreenState’ does not exist in the current context
CS0246 The type or namespace name ‘GameScreen’ could not be found (are you missing a using directive or an assembly reference?)
CS0246 The type or namespace name ‘InputState’ could not be found (are you missing a using directive or an assembly reference?)
Additionally, am I supposed to put this line in the main game’s public Game1() ?
The first argument expected by the constructor is of type Game, which your Game1 class inherits, so you should call it from within your Game1 class. Make sure you create the ScreenManager after creating the GraphicsDeviceManager though.
CS1061 ‘GameScreen’ does not contain a definition for ‘ControllingPlayer’ and no extension method ‘ControllingPlayer’ accepting a first argument of type ‘GameScreen’ could be found
CS1061 ‘GameScreen’ does not contain a definition for ‘Deserialize’ and no extension method ‘Deserialize’ accepting a first argument of type ‘GameScreen’ could be found
Seems like the other files where slightly different in the XNA sample that the blog post starts from. You can just get rid of the controlling player argument and of the serialization function, it’s not functionality you’ll need probably, and if it is you can add it back in. For the other errors, think about what the missing code should handle and if you need it and just remove the code if you don’t.