我已经加入一些纹理我在XNA游戏在一个单独的类加载一个Texture2D,所以我决定做一个单独的类加载和绘制纹理。使用C#和XNA
这是我迄今为止
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace Trolls_and_Towers
{
class Textures
{
//Texture loading
//Buttons
public static Texture2D button;
public static void Load()
{
Microsoft.Xna.Framework.Game game = new Microsoft.Xna.Framework.Game();
button = game.Content.Load<Texture2D>("button");
}
public static void Draw()
{
Game1.spriteBatch.Draw(button, new Rectangle(20, Game1.screenHeight - 70, 100, 50), Color.White);
}
}
}
的问题是,它无法找到该按钮的质感,我知道这是不是拼错了,当我在Load方法加载它我游戏它的工作原理