You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/18_texture_sampling/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ The key changes here are
164
164
- The `_backgroundPattern` field was added to store a reference to the texture of the background pattern once its loaded.
165
165
- The `_backgroundDestination` field was added to define the destination rectangle to draw the background pattern to.
166
166
- The `_backgroundOffset` field was added to apply an offset to the source rectangle when rendering the background pattern to give it the appearance that it is scrolling.
167
-
- The `_scrollSpeed` field was dded to set the speed at which the background pattern scrolls.
167
+
- The `_scrollSpeed` field was added to set the speed at which the background pattern scrolls.
168
168
- In `Initialize`, the initial offset of the background is set to [**Vector2.Zero**](xref:Microsoft.Xna.Framework.Vector2.Zero) and the background destination rectangle is set to the bounds of the screen.
169
169
- In `LoadContent`, the *background-pattern* texture is loaded and stored in `_backgroundPattern`.
170
170
- In `Update`, the X and Y offset for the background source rectangle is calculated by adjusting the based on the scroll speed multiplied by the delta time. Modulo division is then used to ensure that the new offset calculations remain within the width and height bounds of the background texture so that the wrap is seamless.
0 commit comments