我创建了一个按钮图片,我将它命名为Texture2D btn_play
。这是一个主菜单,我想按它来更改CurrentGameState
。如何使用图片照片作为Windows手机按钮
我的变量:
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D Tex_Btn_play;
Rectangle Rec_Btn_play;
enum Menu
{
MainMenu,
Playing,
Exit,
}
Menu CurrentGameState = Menu.MainMenu;
而且Update
方法:
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
if (Rec_Btn_play = TouchLocationState.Pressed);
// TODO: Add your update logic here
base.Update(gameTime);
}
的if (Rec_Btn_play = TouchLocationState.Pressed);
是错的,我不知道为什么。请帮我解决这个问题。
我不明白为什么这个问题是downvoted相交。有没有很好的理由,还是仅仅因为他不知道其他人认为基本的东西? – 2013-05-06 15:49:08
呵呵thx im srr如果它是一个基本的问题是,即时通讯17岁,并从互联网学习东西我开始学习时,我13岁..我尽我所能,所以我可以成为一家游戏公司这将是我的生活:) xD – 2013-05-06 20:48:20