Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Inu_

Member Since 23 Sep 2012
Offline Last Active Apr 02 2013 12:33 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.3K   23 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