0
このクラスで何が間違っていますか?モノゲームとC#を使用していますが、オブジェクトはプログラムでレンダリングされません。私はこのMonogameクラスで何が間違っていますか?
class Player : Game
{
Texture2D PlayerSprite;
Vector2 PlayerPosition;
public Player()
{
Content.RootDirectory = "Content";
PlayerSprite = Content.Load<Texture2D>("spr_Player");
PlayerPosition = Vector2.Zero;
}
public void Update()
{
}
public void Draw(SpriteBatch SpriteBatch)
{
SpriteBatch.Begin();
SpriteBatch.Draw(PlayerSprite,PlayerPosition, new Rectangle(0, 0, 32,32), Color.White);
SpriteBatch.End();
}
}
は、あなたがエラーを取得するのですか? – CodingYoshi
エラーなし、コンパイル時にオブジェクトが表示されません。それはGame1クラスの別のものを参照するべきであるというプレーヤーと呼ばれる別のクラスにありますか? –
@Liam Earle、どこにプレーヤーを作りますか? – vyrp