Quellcode durchsuchen

Small changed to CatapultNetWars and Draw2D

Dean Ellis vor 13 Jahren
Ursprung
Commit
57946fb57b

+ 13 - 0
Samples/MacOS/CatapultNetWars/Networking/LobbyScreen.cs

@@ -15,6 +15,7 @@ using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Net;
 using GameStateManagement;
+using Microsoft.Xna.Framework.Input.Touch;
 #endregion
 
 namespace CatapultGame
@@ -45,6 +46,7 @@ namespace CatapultGame
 		/// </summary>
 		public LobbyScreen (NetworkSession networkSession)
 			{
+			EnabledGestures = GestureType.Tap;
 			this.networkSession = networkSession;
 
 			TransitionOnTime = TimeSpan.FromSeconds (0.5);
@@ -116,6 +118,17 @@ namespace CatapultGame
 					HandleMenuCancel (gamer);
 				}
 			}
+			
+			if (input.Gestures.Count > 0)
+			{
+				foreach(var g in input.Gestures)
+				{
+					if (g.GestureType == Microsoft.Xna.Framework.Input.Touch.GestureType.Tap)
+					{
+						HandleMenuSelect(networkSession.LocalGamers[0]);
+					}
+				}
+			}
 		}
 
 

+ 3 - 0
Samples/MacOS/CatapultNetWars/Screens/MessageBoxScreen.cs

@@ -13,6 +13,7 @@ using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Content;
 using Microsoft.Xna.Framework.Graphics;
 using CatapultGame;
+using Microsoft.Xna.Framework.Input.Touch;
 #endregion
 
 namespace GameStateManagement
@@ -55,6 +56,8 @@ namespace GameStateManagement
         /// </summary>
         public MessageBoxScreen(string message, bool includeUsageText)
         {
+			EnabledGestures = GestureType.Tap;
+			
             if (includeUsageText)
                 this.message = message + Resources.MessageBoxUsage;
             else

+ 4 - 0
Samples/iOS/Draw2D/Game1.cs

@@ -82,6 +82,10 @@ namespace Microsoft.Xna.Samples.Draw2D
 		/// <param name="gameTime">Provides a snapshot of timing values.</param>
 		protected override void Update (GameTime gameTime)
 		{
+			if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
+			{
+				Exit();
+			}
 			// TODO: Add your update logic here
 			size += 0.5f;
 			if (size > 150) {