当sourcerect精确时,C#spritesheet显示相邻的分幅
我的问题是: 我曾尝试在spritesheet上的瓷砖之间添加一个空格,它只是将相邻瓷砖的轮廓更改为边缘稍浅的版本,我认为这是抗锯齿,但我的spritebatch.Begin是:当sourcerect精确时,C#spritesheet显示相邻的分幅,c#,monogame,C#,Monogame,我的问题是: 我曾尝试在spritesheet上的瓷砖之间添加一个空格,它只是将相邻瓷砖的轮廓更改为边缘稍浅的版本,我认为这是抗锯齿,但我的spritebatch.Begin是: spriteBatch.Begin(SpriteSortMode.frontoback,null,samplestate.PointClamp,null,null,Main.cam.Completetransformation()*Main.DrawScaling) 在base Draw()中调用SpriteBatch
spriteBatch.Begin(SpriteSortMode.frontoback,null,samplestate.PointClamp,null,null,Main.cam.Completetransformation()*Main.DrawScaling)代码>
在base Draw()中调用SpriteBatch.Begin,而Image.Draw()是调用SpriteBatch.Draw()的地方
我的Image类的运行方式如下:
Image.LayerDepth = layerDepth;
Image.Position = tile.position;
Image.SourceRect = tile.SourceRect;
Image.Color = tile.Color;
Image.Draw(spriteBatch);
和图像。绘制(SpriteBatch SpriteBatch):
我在谷歌上搜索了不同的spritebatch开始模式,我不知道我遗漏了什么,SourceRect始终是32*32(等于瓷砖大小),而且我没有发现位置问题,所以我完全没有想法
编辑:我也有
Graphics.PreferMultiSampling = false;
Graphics.ApplyChanges();
在my Initialize()中,我们可以看到调用Image.Draw()的Draw()方法吗?假设SpriteBatch.Begin()位于该方法中。这是“public void Draw”方法。它位于“Image”类中,SpriteBatch.Begin()在前面被调用
Graphics.PreferMultiSampling = false;
Graphics.ApplyChanges();