XNA spritebatch.End();有一个类没有用,它说:' XNA Framework Reach配置文件要求TextureAddressMode在使用不是2的幂的纹理大小时是Clamp。'什么时候开始并且它也没有显示任何错误。我怎么解决这个问题?请帮忙!!
public override void Draw()
{
Statics.SPRITEBATCH.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, null,null);
Statics.SPRITEBATCH.Draw(this.background, Vector2.Zero, Color.White);
foreach (var item in Tuyaux)
{
item.Draw();
}
Statics.SPRITEBATCH.Draw(this.sand, new Vector2(0, 529), Color.White);
Scroll.Draw();
Bird.Draw();
Statics.SPRITEBATCH.DrawString(this.Font, "Score : " + this.score.ToString(), new Vector2(10, 10), Color.Red);
if (Bird.dead)
{
// rode gloed over het spel als het gameover is.
Statics.SPRITEBATCH.Draw(Statics.PIXEL, new Rectangle(0,0, Statics.GAME_WIDTH,Statics.GAME_HEIGHT), new Color(1f, 0f, 0f, 0.3f));
// gameover achtergrond laten zien.
Statics.SPRITEBATCH.Draw(this.gameover, new Vector2(0, 80), Color.White);
}
Statics.SPRITEBATCH.End();
base.Draw();
}
答案 0 :(得分:0)
问题正是异常告诉你的:
您正在定位Reach配置文件,因此要么所有纹理尺寸必须是2的幂,要么必须使用clamp作为地址模式。所以:
SamplerState.LinearWrap
来电中将SamplerState.LinearClamp
替换为Statics.SPRITEBATCH.Begin
。HiDef
个人资料而不是Reach