現在、C#XNA 4.0をいじっていますが、既存のTexture2DにTexture2Dを割り当てる際に問題が発生しています。以下に示すコードの例:
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
texDisc48 = Content.Load<Texture2D>("textures/disc_24");
texDisc48 = Content.Load<Texture2D>("textures/disc_48");
texDisc96 = Content.Load<Texture2D>("textures/disc_96");
}
// Random place in the code
texCurrentDisc = texDisc96;
しかし、etc DrawでtexCurrentDiscを使用しようとすると、次のエラーが発生 します。このメソッドはこのパラメーターにnullを受け入れません。パラメータ名:texture。texCurrentDiscは、次のように初期化されます。Texture2D texCurrentDisc;