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
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,13 @@ One aspect of sampler states if the filtering mode. Filtering in computer graph
45
45
46
46
Think of filtering as the graphics hardware's strategy for filling in missing information when a texture is transformed. When you enlarge a texture, the system needs to create new pixels that did not exist in the original. When you shrink a texture, multiple original pixels must be combined into fewer output pixels. The filtering mode controls how this process happens.
47
47
48
-
There are three filtering modes available in MonoGame; Point, Linear, and Anisotropic. Each mode offers a different balance between performance and visual quality.
48
+
There are three filtering modes available in MonoGame:
49
+
50
+
* Point
51
+
* Linear
52
+
* Anisotropic.
53
+
54
+
Each mode offers a different balance between performance and visual quality.
## Adding a Scrolling Background to the Title Scene
142
148
143
-
We will now update title scene of our game by adding a scrolling background pattern using [**SamplerState.PointWrap**](xref:Microsoft.Xna.Framework.Graphics.SamplerState.PointWrap). By using the Wrap addressing mode, we can create a large scrolling background using only a small texture. When the texture is drawn with a destination rectangle larger than the texture itself, the Wrap mode will automatically tile the texture to fill the space. Then, by adjusting the source rectangle over time, we can create a scrolling effect with minimal effort.
149
+
We will now update title scene of our game by adding a scrolling background pattern using [**SamplerState.PointWrap**](xref:Microsoft.Xna.Framework.Graphics.SamplerState.PointWrap). By using the Wrap addressing mode, we can create a large scrolling background using only a small texture. When the texture is drawn with a destination rectangle larger than the texture itself, the Wrap mode will automatically tile the texture to fill the space. By adjusting the source rectangle over time, we can create a scrolling effect with minimal effort.
144
150
145
-
First, download the following image of a repeatable background pattern by right-clicking it and saving it as *background-pattern.png* in the *Content/images* folder of the game project:
151
+
First, download the following image of a repeatable background pattern by right-clicking it and saving it as `background-pattern.png` in the `Content/images` folder of the game project:
146
152
147
153
||
|**Figure 18-9: The repeatable background pattern we will use for the title screen**|
150
156
151
157
Next, add this texture to your content project using the MGCB Editor:
152
158
153
-
1. Open the *Content.mgcb* content project file in the MGCB Editor.
154
-
2. Right-click the images folder and choose *Add* > *Existing item...*.
155
-
3. Navigate to and select the *background-pattern.png* file.
159
+
1. Open the `Content.mgcb` content project file in the MGCB Editor.
160
+
2. Right-click the images folder and choose `Add > Existing item...`.
161
+
3. Navigate to and select the `background-pattern.png` file.
156
162
4. Save the changes and close the MGCB Editor.
157
163
158
164
||
@@ -161,9 +167,9 @@ Next, add this texture to your content project using the MGCB Editor:
161
167
162
168
### Updating the Title Scene
163
169
164
-
Now that we have the background pattern texture added, we can update the `TitleScene` class to implement the scrolling background. Open the *TitleScene.cs* file in the game project and update it to the following
170
+
Now that we have the background pattern texture added, we can update the `TitleScene` class to implement the scrolling background. Open the `TitleScene.cs` file in the game project and update it to the following
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/index.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,11 @@ The following conventions are used in this documentation.
48
48
49
49
### Italics
50
50
51
-
*Italics* are used for emphasis, technical terms, and paths such as file paths, including filenames and extensions.
51
+
*Italics* are used for emphasis and technical terms.
52
+
53
+
### Highlights
54
+
55
+
`Highlights` are used for paths such as file paths, including filenames, extensions and other critical information in the application of steps in a tutorial. These are similar to Inline code blocks as they stand out more in Markdown and require emphasis.
0 commit comments