Sfoglia il codice sorgente

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 anni fa
parent
commit
2cca8109ed
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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
 // begin the sprite batch operations
-spriteBatch.Begin(GraphicsContext, SpriteSortMode.Immediate);
+spriteBatch.Begin(Game.GraphicsContext, SpriteSortMode.Immediate);
  
 // draw the sprite immediately
 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
 // 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
 spriteBatch.Draw(myTexture, new Vector2(10, 20));