Skip to content

Commit e61f217

Browse files
Resolves MonoGame#53
1 parent 86d4606 commit e61f217

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/getting_to_know/howto/graphics/HowTo_Tile_Sprites.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ We will simply define an area ([Rectangle](xref:Microsoft.Xna.Framework.Rectangl
1212

1313
### End result
1414

15-
![The output of this tutorial](images/HowTo_Tile_Sprites_Final.png)
15+
![The output of this tutorial](./images/HowTo_Tile_Sprites_Final.png)
1616

1717
## Requirements
1818

19-
![Sprite to Tile](images/MonoGame.png)
19+
![Sprite to Tile](./images/MonoGame.png)
2020

2121
## Drawing a Tiled a Sprite
2222

2323
1. Follow the procedures of [Drawing a Sprite](HowTo_Draw_A_Sprite.md).
2424
1. Setup some new variables to define how we want to draw the tiled area and with which Texture.
2525

2626
```csharp
27-
// Tiling Texture
27+
// Tiling Texture
2828
private Texture2D monoGameLogo;
2929
// How many tiles wide
3030
private int tileCountWidth = 2;
@@ -67,13 +67,13 @@ We will simply define an area ([Rectangle](xref:Microsoft.Xna.Framework.Rectangl
6767
1. Call [SpriteBatch.Draw](xref:Microsoft.Xna.Framework.Graphics.SpriteBatch#Microsoft_Xna_Framework_Graphics_SpriteBatch_Draw_Microsoft_Xna_Framework_Graphics_Texture2D_Microsoft_Xna_Framework_Vector2_Microsoft_Xna_Framework_Color_) with the sprite, the destination rectangle, and other relevant parameters.
6868

6969
```csharp
70-
_spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.Opaque, SamplerState.LinearWrap, DepthStencilState.Default, RasterizerState.CullNone);
70+
_spriteBatch.Draw(monoGameLogo, Vector2.Zero, targetRectangle, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
7171
```
7272

7373
1. Call [SpriteBatch.End](xref:Microsoft.Xna.Framework.Graphics.SpriteBatch#Microsoft_Xna_Framework_Graphics_SpriteBatch_End) on your [SpriteBatch](xref:Microsoft.Xna.Framework.Graphics.SpriteBatch) object.
7474

7575
```csharp
76-
spriteBatch.End();
76+
_spriteBatch.End();
7777
```
7878

7979
## See Also

0 commit comments

Comments
 (0)