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>())); } }
//----------------------------------------------------------------------------------------------- // 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); }
//----------------------------------------------------------------------------------------------- // PlayButtonOnTap - shift screen to the game screen //----------------------------------------------------------------------------------------------- public VarmintWidget.EventHandledState PlayButtonOnTap(VarmintWidget tappedObject, Vector2 tapPosition) { StartGame(); return(VarmintWidget.EventHandledState.Handled); }
public VarmintWidget.EventHandledState HandleTap(VarmintWidget widget, Vector2 location) { FooCalls++; return(VarmintWidget.EventHandledState.Handled); }