Przeglądaj źródła

Remove Width and Height Scale, as that is all handled by GlobalTransformation now.

Dominique Louis 1 miesiąc temu
rodzic
commit
efb618b3f5

+ 1 - 2
CardsStarterKit/Core/Game/Blackjack/Game/BlackjackCardGame.cs

@@ -42,8 +42,7 @@ namespace Blackjack
 
         // An offset used for drawing the second hand which appears after a split in
         // the correct location.
-        Vector2 secondHandOffset =
-            new Vector2(100 * BlackjackGame.WidthScale, 25 * BlackjackGame.HeightScale);
+        Vector2 secondHandOffset = new Vector2(100, 25);
         static Vector2 ringOffset = new Vector2(0, 110);
 
         Vector2 frameSize = new Vector2(180, 180);

+ 2 - 3
CardsStarterKit/Core/Game/Blackjack/Misc/BetGameComponent.cs

@@ -37,9 +37,8 @@ namespace Blackjack
         Button clear;
 
         Vector2 ChipOffset { get; set; }
-        static float insuranceYPosition = 120 * BlackjackGame.HeightScale;
-        static Vector2 secondHandOffset = new Vector2(25 * BlackjackGame.WidthScale,
-            30 * BlackjackGame.HeightScale);
+        static float insuranceYPosition = 120;
+        static Vector2 secondHandOffset = new Vector2(25, 30);
 
         List<AnimatedGameComponent> currentChipComponent = new List<AnimatedGameComponent>();
         int currentBet = 0;

+ 0 - 7
CardsStarterKit/Core/Game/BlackjackGame.cs

@@ -28,9 +28,6 @@ namespace Blackjack
         GraphicsDeviceManager graphicsDeviceManager;
         ScreenManager screenManager;
 
-        public static float HeightScale = 1.0f;
-        public static float WidthScale = 1.0f;
-
         /// <summary>
         /// Initializes a new instance of the game.
         /// </summary>
@@ -73,10 +70,6 @@ namespace Blackjack
             graphicsDeviceManager.PreferredBackBufferWidth = ScreenManager.BASE_BUFFER_WIDTH;
             graphicsDeviceManager.PreferredBackBufferHeight = ScreenManager.BASE_BUFFER_HEIGHT;
             graphicsDeviceManager.ApplyChanges();
-
-            float scale = screenManager.GlobalTransformation.M11; // uniform scale
-            HeightScale = scale;
-            WidthScale = scale;
         }
 
         /// <summary>

+ 4 - 6
CardsStarterKit/Core/Game/Screens/GameplayScreen.cs

@@ -29,9 +29,9 @@ namespace Blackjack
 
         static Vector2[] playerCardOffset = new Vector2[]
         {
-            new Vector2(100f * BlackjackGame.WidthScale, 190f * BlackjackGame.HeightScale),
-            new Vector2(336f * BlackjackGame.WidthScale, 210f * BlackjackGame.HeightScale),
-            new Vector2(570f * BlackjackGame.WidthScale, 190f * BlackjackGame.HeightScale)
+            new Vector2(100f, 190f),
+            new Vector2(336f, 210f),
+            new Vector2(570f, 190f)
         };
 
         /// <summary>
@@ -181,9 +181,7 @@ namespace Blackjack
                 case 0:
                 case 1:
                 case 2:
-                    return new Vector2(ScreenManager.SafeArea.Left,
-                        ScreenManager.SafeArea.Top + 200 * (BlackjackGame.HeightScale - 1)) +
-                        playerCardOffset[player];
+                    return playerCardOffset[player];
                 default:
                     throw new ArgumentException(
                         "Player index should be between 0 and 2", "player");