示例#1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public App()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            graphics.SupportedOrientations = DisplayOrientation.Portrait;

            // FOR SINGLETON PURPOSE
            content = Content;
            game = this;
            if (SettingsManager.Instance.Device == SettingsManager.EDevice.SURFACE)
            {
                ti = new TouchInput();
                Constants.Measures.portraitHeight = 1080;
                Constants.Measures.portraitWidth = 1920;
                //Constants.Measures.leftBoardMargin = (float)Math.Round((Constants.Measures.portraitHeight - Constants.Measures.boardBlockWidth * Constants.Measures.blockSize) / 2f);
                //Constants.Measures.upBoardMargin = (float)Math.Round((Constants.Measures.portraitWidth - Constants.Measures.boardBlockHeight * Constants.Measures.blockSize) / 2f);
            }
            else
            {
                ti = new KeyboardInput();
                Constants.Measures.portraitHeight = 980;
                Constants.Measures.portraitWidth = 500;
                //Constants.Measures.leftBoardMargin = (float)Math.Round((Constants.Measures.portraitWidth - Constants.Measures.boardBlockWidth * Constants.Measures.blockSize) / 2f);
                //Constants.Measures.upBoardMargin = (float)Math.Round((Constants.Measures.portraitHeight - Constants.Measures.boardBlockHeight * Constants.Measures.blockSize) / 2f);
            }

            //graphics.ToggleFullScreen();
            //
        }
示例#2
0
 public float getLeftMargin(AUserInput.EGameMode gm)
 {
     switch (gm)
     {
         case AUserInput.EGameMode.MULTI1P:
             return 10f;
         case AUserInput.EGameMode.MULTI2P:
             return 1400f;
         default: // SOLO
             return 704f;
     }
 }