Skip to content

Commit 0ec771c

Browse files
Update conventions and proof chapter 18
1 parent 0490ba5 commit 0ec771c

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

articles/tutorials/building_2d_games/18_texture_sampling/index.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ One aspect of sampler states if the filtering mode. Filtering in computer graph
4545

4646
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.
4747

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.
4955

5056
#### Point Filtering Mode
5157

@@ -140,19 +146,19 @@ spriteBatch.Begin(samplerState: SamplerState.PointClamp);
140146
141147
## Adding a Scrolling Background to the Title Scene
142148

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.
144150

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:
146152

147153
| ![Figure 18-9: The repeatable background pattern we will use for the title screen](./images/background-pattern.png) |
148-
| :---------------------------------------------------------------------------------------------------------------: |
154+
| :---------------------------------------------------------------------------------------------------------------: |
149155
| **Figure 18-9: The repeatable background pattern we will use for the title screen** |
150156

151157
Next, add this texture to your content project using the MGCB Editor:
152158

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.
156162
4. Save the changes and close the MGCB Editor.
157163

158164
| ![Figure 18-9: The MGCB Editor with the *background-pattern* image added](./images/mgcb-editor.png) |
@@ -161,9 +167,9 @@ Next, add this texture to your content project using the MGCB Editor:
161167

162168
### Updating the Title Scene
163169

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
165171

166-
[!code-csharp[](./snippets/titlescene.cs?highlight=39-50,79-81,92-93,104-113,120-123)]
172+
[!code-csharp[](./snippets/titlescene.cs?highlight=39-50,76-81,92-93,104-113,120-123)]
167173

168174
The key changes here are
169175

articles/tutorials/building_2d_games/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ The following conventions are used in this documentation.
4848

4949
### Italics
5050

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.
5256

5357
### Inline Code Blocks
5458

0 commit comments

Comments
 (0)