Browse Source

The code didn't work out of the box

I think someone new to this won't know where to get the GraphicsContext from and since it is only that one most of the time this should get written into the docs.
Niklas Arndt 2 years ago
parent
commit
2cca8109ed
1 changed files with 2 additions and 2 deletions
  1. 2 2
      en/manual/graphics/low-level-api/spritebatch.md

+ 2 - 2
en/manual/graphics/low-level-api/spritebatch.md

@@ -36,7 +36,7 @@ The @'Stride.Graphics.SpriteBatch' class has multiple draw methods to set variou
 
 
 ```cs
 ```cs
 // begin the sprite batch operations
 // begin the sprite batch operations
-spriteBatch.Begin(GraphicsContext, SpriteSortMode.Immediate);
+spriteBatch.Begin(Game.GraphicsContext, SpriteSortMode.Immediate);
  
  
 // draw the sprite immediately
 // draw the sprite immediately
 spriteBatch.Draw(myTexture, new Vector2(10, 20));
 spriteBatch.Draw(myTexture, new Vector2(10, 20));
@@ -59,7 +59,7 @@ To set the mode, specify it in the @'Stride.Graphics.SpriteBatch.Begin' method.
 
 
 ```cs
 ```cs
 // begin the sprite batch operations
 // begin the sprite batch operations
-spriteBatch.Begin(GraphicsContext); // same as spriteBatch.Begin(GraphicsContext, SpriteSortMode.Deferred);
+spriteBatch.Begin(Game.GraphicsContext); // same as spriteBatch.Begin(GraphicsContext, SpriteSortMode.Deferred);
 
 
 // store the modification of the sprite
 // store the modification of the sprite
 spriteBatch.Draw(myTexture, new Vector2(10, 20));
 spriteBatch.Draw(myTexture, new Vector2(10, 20));