/// <summary> /// Load your graphics content. /// </summary> protected override void LoadContent() { // Load content belonging to the screen manager. ContentManager content = Game.Content; //TODO remove next line!!!! MenuResources.LoadContent(content); spriteBatch = new SpriteBatch(GraphicsDevice); font = content.Load <SpriteFont>("menufont"); blankTexture = content.Load <Texture2D>("blank"); // Tell each of the screens to load their content. foreach (GameScreen screen in screens) { screen.LoadContent(); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { // Set the sharing mode of the graphics device to turn on XNA rendering SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(true); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(SharedGraphicsDeviceManager.Current.GraphicsDevice); // TODO: use this.content to load your game content here MenuResources.LoadContent(contentManager); gameLevel = new TestLevel1(new Dictionary <string, Texture2D>()); gameLevel.SpriteBatch = spriteBatch; gameLevel.GraphicsDevice = SharedGraphicsDeviceManager.Current.GraphicsDevice; gameLevel.LoadContent(); // Start the timer timer.Start(); base.OnNavigatedTo(e); }
public HomePage() { InitializeComponent(); if (Device.OS == TargetPlatform.Android) { Master.Title = L10n.Localize("MasterTitleAndroid"); //Master.Icon = "select.png"; Master.Padding = 2; } else if (Device.OS == TargetPlatform.WinPhone) { Master.Title = L10n.Localize("MasterTitleAndroid"); //Master.Icon = "swap.png"; } else if (Device.OS == TargetPlatform.iOS) { Master.Title = L10n.Localize("MasterTitleAndroid"); //Master.Title = "Resources/select.png"; } else if (Device.OS == TargetPlatform.Windows) { Master.Title = L10n.Localize("MasterTitleAndroid"); //Master.Icon = "Assets/select.png"; } var r = new MenuResources(); MenuList.ItemsSource = r.GetNames(); }