Sign in to follow this  
Inu_

Problem Tiling a Sprite

Recommended Posts

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:

[attachment=12654:tilingsprite.png]


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

[CODE]
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();
[/CODE] Edited by Inu_

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this