0
오히려 기본 Texture2D 이름 rect가 있고 그것을 초기화하려고합니다. 이 필드 이니셜 라이저가texture2d 사각형 XNA가 초기화되지 않습니다
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
//my variables and stuff I delcare
//texture we can render
Texture2D myTexture;
//set coords to draw the spirte
Vector2 spritePos = new Vector2(300.0f, 330.0f);
//some info about motion
Vector2 spriteSpeed = new Vector2(0f, 0f);
KeyboardState oldState;
double boost = 15;
//boost level rectange this is the issue below+
Texture2D rect = new Texture2D(graphics.GraphicsDevice, 80, 30);
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
라인을'LoadContent' 메소드 (또는 그것이 호출 된 것)로 옮깁니다. – Athari