コード例 #1
0
 public static VarmintWidget LoadFromText(IVarmintWidgetInjector injector, string vwml, string defaultName)
 {
     using (var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(vwml)))
     {
         var layout = VarmintWidget.PreloadFromVwml(memoryStream, defaultName);
         return(VarmintWidget.HydrateLayout(injector, layout, new Dictionary <string, VarmintWidget.LayoutItem>()));
     }
 }
コード例 #2
0
        //-----------------------------------------------------------------------------------------------
        // GameQuitButtonOnTap - Clean up the game and return to main screen
        //-----------------------------------------------------------------------------------------------
        public VarmintWidget.EventHandledState GameQuitButtonOnTap(VarmintWidget tappedObject, Vector2 tapPosition)
        {
            _controller.GetVisibleWidgetByName("GameContainer").ClearChildren();
            _controller.SetScreen(_controller.GetScreen("MainScreen", this));
            _currentGame = null;

            return(VarmintWidget.EventHandledState.Handled);
        }
コード例 #3
0
ファイル: GameRunner.cs プロジェクト: nebosite/MonoVarmint
 //-----------------------------------------------------------------------------------------------
 // PlayButtonOnTap - shift screen to the game screen
 //-----------------------------------------------------------------------------------------------
 public VarmintWidget.EventHandledState PlayButtonOnTap(VarmintWidget tappedObject, Vector2 tapPosition)
 {
     StartGame();
     return(VarmintWidget.EventHandledState.Handled);
 }
コード例 #4
0
 public VarmintWidget.EventHandledState HandleTap(VarmintWidget widget, Vector2 location)
 {
     FooCalls++;
     return(VarmintWidget.EventHandledState.Handled);
 }