我正在使用xog的Monogame实现在Windows商店中开发一个简单的空气曲棍球游戏,如果任何一个玩家获得7分,我将导航到一些XAML页面
这是我在Update方法中使用的逻辑
protected override void Update(GameTime gameTime)
{
DrawGame();
if (player1.Score == 7)
{
try
{
PlayerOneScore = player1.Score;
PlayerTwoScore = player2.Score;
App.WinningFlag = true;
App.WinningPlayer = PlayerOneName;
this.Exit();
if (BaseCount == 0)
{
//Navigation to next page
BaseCount++;
Frame ff = new Frame();
ff.Navigate(typeof(NextPage));
Windows.UI.Xaml.Window.Current.Content = ff;
Windows.UI.Xaml.Window.Current.Activate();
}
}
catch (Exception)
{
throw;
}
}
base.Update(gameTime);
}
Run Code Online (Sandbox Code Playgroud)
但是我看到Update和Draw的方法仍然被调用,为什么呢?虽然我已编写代码以离开此页面,但在NextPage中还有一个用于重新启动游戏的按钮
在NextPage中单击按钮重启游戏的事件
private void btnStartNewGame_Click(object sender, RoutedEventArgs e)
{
var app = App.Current as App;
if (app.GamePage != null)
{ app.GamePage …Run Code Online (Sandbox Code Playgroud) 我正在创建一个应用程序,我想从我在隔离存储中存储的图像中创建pdf.许多开源库可用于解决目的,但不幸的是没有人表达它们与Windows Phone 8的可比性.
然后我遇到了这个链接
该帖子解释了如何通过制作pdf标题来编写pdf文件.但是,这只会创建一个带有一些文本的pdf.我,现在想在其中添加一些图像.我该如何处理呢?