C# spritesheet shows adjacent tiles when sourcerect is exact

Viewed 59

Ok so my problem is that: this shows a small outline between tiles that isn't there on the spritesheet

I've tried adding a space between tiles on the spritesheet, it just changed the outline from the adjacent tile to a slightly lighter version of the edge, I think it's anti - aliasing but my spritebatch.Begin is:

spriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.PointClamp, null, null, null, Main.cam.Completetransformation() * Main.DrawScaling);

SpriteBatch.Begin is called in the base Draw() and the Image.Draw() is where spriteBatch.Draw() is called

and my Image class runs like this:

                        Image.LayerDepth = layerDepth;
                        Image.Position = tile.position;
                        Image.SourceRect = tile.SourceRect;
                        Image.Color = tile.Color;

                        Image.Draw(spriteBatch);

and Image.Draw(SpriteBatch spriteBatch):

        public void Draw(SpriteBatch spriteBatch)
        {
                origin = Vector2.Zero;
                spriteBatch.Draw(Texture, Position, SourceRect, Color * Alpha, 0.0f, origin, Scale, SpriteEffects.None, LayerDepth / 100);
        }

I've googled different spritebatch begin modes ect and I have no Idea what I"m missing, the SourceRect is 32 * 32 at all times (equal to the tile size) and I haven't found an issue with position so I'm all out of ideas

Edit: I do also have

            Graphics.PreferMultiSampling = false;
            Graphics.ApplyChanges();

In my Initialize()

0 Answers
Related