Skip to content

Instantly share code, notes, and snippets.

@kenpower
Created November 8, 2012 12:50
Show Gist options
  • Save kenpower/4038613 to your computer and use it in GitHub Desktop.
Save kenpower/4038613 to your computer and use it in GitHub Desktop.
Drawing infinite scrolling translucent clouds
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearWrap, null, null);
spriteBatch.Draw(clouds,
new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width,
graphics.GraphicsDevice.Viewport.Height),
new Rectangle((int)cloudPos.X, (int)cloudPos.Y, 300,300),
Color.White);
spriteBatch.End();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment