-1
\$\begingroup\$

I draw a TiledMap with TiledSharp and i've introduced a resize factor when drawing, that looks like this:

SpriteBatch.Draw(TileSet                                                   // The input Texture2D
                 , new Rectangle((int)x                                    // The tile rectangle
                                 , (int)y
                                 , tileWidth * ScaleFactor
                                 , tileHeight * ScaleFactor)
                 , tilesetRec                                              // The tile offset on tileset texture
                 , Color.White);                                           // just white

(note: it's not formated on different lines in my code, it's just i'm making it such way that anyone can understand without having previous lines)

but when i start the game it end up really blured and has some Strange outline enter image description here

Can someone help me getting really sharp tiles instead of this?

N.B: i Don't want to resize the tileset file, it's to complicated for later modifications regarding the 16x16 style i want for my game. also i'm using Tiled to generate the Tiled Map but i Don't think this last info is relevent.

\$\endgroup\$
6
  • \$\begingroup\$ also, is it normal that stackexchange remove any form of civilization ("hi", "hello" ...)? \$\endgroup\$ Jun 4, 2020 at 14:08
  • \$\begingroup\$ Does this help with your issue? And yes, it's normal. We prefer a straight-to-the point style for Q&A on this site, so folks get to your question and you get to your answers as efficiently as possible. 🙂 \$\endgroup\$
    – DMGregory
    Jun 4, 2020 at 14:09
  • \$\begingroup\$ I'll try out @DMGregory i come back here after \$\endgroup\$ Jun 4, 2020 at 14:10
  • \$\begingroup\$ Well Thanks it worked! \$\endgroup\$ Jun 4, 2020 at 14:12
  • \$\begingroup\$ Glad to hear it! I'll close this question as a duplicate for now, to direct folks who find it via search to the existing answers. If you need something different, please feel free to edit the question or post a new question. \$\endgroup\$
    – DMGregory
    Jun 4, 2020 at 14:15

1 Answer 1

1
\$\begingroup\$

Thanks to @DMGregory, i've Added the parametter samplerState on SpriteBatch.Begin that fixed everything

SpriteBatch.Begin(transformMatrix: DisplayOffsetMatrix, samplerState: SamplerState.PointClamp);

enter image description here

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .