Jump to content

  • Log In with Google      Sign In   
  • Create Account

Inu_

Member Since 23 Sep 2012
Offline Last Active Oct 17 2014 03:20 PM

Topics I've Started

Problem Tiling a Sprite

07 December 2012 - 05:29 PM

I have na 32x32 sprite that is going to be the Grass/ground of my game, and I am trying to make it fill the entire screen, but the image actualy becomes all distorced.

Here is a picture of the problem:

Attached File  tilingsprite.png   15.3KB   43 downloads


And here is the Draw code(using XNA 4.0):

  spriteBatch.Begin(SpriteSortMode.BackToFront,
						BlendState.AlphaBlend,
						null,
						null,
						null,
						null);
			GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;
			Rectangle source = new Rectangle(0, 0, 500, 500);
			spriteBatch.Draw(spritetest, Vector2.Zero ,source, Color.White, 0, Vector2.Zero,1.0f, SpriteEffects.None, 0.5f);
  spriteBatch.End();

PARTNERS