Skip to content

Commit d3e6fc9

Browse files
authored
Merge branch 'main' into main
2 parents 35e6e24 + e39f730 commit d3e6fc9

File tree

14 files changed

+198
-36
lines changed

14 files changed

+198
-36
lines changed

articles/getting_to_know/whatis/graphics/WhatIs_Sprite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Sprites are 2D bitmaps that are drawn directly to a render target without using
1717

1818
## Overview
1919

20-
Sprites are positioned on the screen by coordinates. The width and height of the screen is the same as the back buffer. The x-axis represents the screen width and the y-axis represents the screen height. The y-axis is measured from the top of the screen and increases as you move **down** the screen, and the x-axis is measured from left to right. For example, when the graphics back buffer is 800×600, 0,0 is the upper left of the screen, and 800,600 is the lower right of the screen.
20+
Sprites are positioned on the screen by coordinates. The width and height of the screen is the same as the back buffer. The x-axis represents the screen width and the y-axis represents the screen height. The y-axis is measured from the top of the screen and increases as you move **down** the screen, and the x-axis is measured from left to right. For example, when the graphics back buffer is 800×600, the top left corner is at (0,0) and the bottom-right pixel is at (799,599).
2121

2222
To draw a sprite, create a [SpriteBatch](xref:Microsoft.Xna.Framework.Graphics.SpriteBatch) object, initialize it by calling [Begin](/api/Microsoft.Xna.Framework.Graphics.SpriteBatch.html#Microsoft_Xna_Framework_Graphics_SpriteBatch_Begin_Microsoft_Xna_Framework_Graphics_SpriteSortMode_Microsoft_Xna_Framework_Graphics_BlendState_Microsoft_Xna_Framework_Graphics_SamplerState_Microsoft_Xna_Framework_Graphics_DepthStencilState_Microsoft_Xna_Framework_Graphics_RasterizerState_Microsoft_Xna_Framework_Graphics_Effect_System_Nullable_Microsoft_Xna_Framework_Matrix__), and then call [Draw](/api/Microsoft.Xna.Framework.Graphics.SpriteBatch.html#Microsoft_Xna_Framework_Graphics_SpriteBatch_Draw_Microsoft_Xna_Framework_Graphics_Texture2D_Microsoft_Xna_Framework_Rectangle_Microsoft_Xna_Framework_Color_) for each sprite. The bitmap data for a sprite is taken from a [Texture2D](xref:Microsoft.Xna.Framework.Graphics.Texture2D) object. The texture may contain alpha channel information to make part of the texture transparent or semi-transparent. You can tint, rotate, or scale sprites by using [Draw](/api/Microsoft.Xna.Framework.Graphics.SpriteBatch.html#Microsoft_Xna_Framework_Graphics_SpriteBatch_Draw_Microsoft_Xna_Framework_Graphics_Texture2D_Microsoft_Xna_Framework_Rectangle_Microsoft_Xna_Framework_Color_). This method also gives you the option of drawing only part of the texture on the screen. After you draw a sprite, call [End](/api/Microsoft.Xna.Framework.Graphics.SpriteBatch.html#Microsoft_Xna_Framework_Graphics_SpriteBatch_End) before calling [Present](xref:Microsoft.Xna.Framework.Graphics.GraphicsDevice.Present).
2323

articles/samples.md

Lines changed: 162 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,173 @@
11
---
22
title: Samples & Demos
3-
description: Recommended samples and demos for learning how to use MonoGame.
3+
description: The recommended samples and demos for learning how to use MonoGame.
44
---
55

6-
The samples and demos below are recommended for learning how to use MonoGame.
7-
8-
## Official MonoGame tutorial source
9-
10-
- [Building 2D Games](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/Tutorials/learn-monogame-2d)
11-
126
## Official MonoGame Samples
137

14-
These are [the official samples](https://github.com/MonoGame/MonoGame.Samples) that contain the following:
8+
These are [the official samples](https://github.com/MonoGame/MonoGame.Samples):
9+
10+
## 2D Samples
11+
12+
<section class="container-xxl mb-5">
13+
<div class="row">
14+
<div class="col-12 col-lg-4 mb-5">
15+
<div class="mg-card mg-box-shadow h-100">
16+
<a target="_self"
17+
href="https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/AutoPong"
18+
class="mg-no-link">
19+
<div class="mg-card-body d-flex flex-column h-100">
20+
<div class="mg-card-title"><i class="bi bi-arrow-bar-right"></i> AutoPong Sample 2D</div>
21+
<p>
22+
This project shows you how to make the classic game of pong, with basic soundfx, in 300 lines of code.
23+
The sample has no content and no content manager use, just code!
24+
</p>
25+
<p class="mt-auto">Check out the AutoPong sample</p>
26+
</div>
27+
</a>
28+
</div>
29+
</div>
30+
<div class="col-12 col-lg-4 mb-5">
31+
<div class="mg-card mg-box-shadow h-100">
32+
<a target="_self"
33+
href="https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/Platformer2D"
34+
class="mg-no-link">
35+
<div class="mg-card-body d-flex flex-column h-100">
36+
<div class="mg-card-title"><i class="bi bi-body-text"></i> Platformer Sample 2D</div>
37+
<p>
38+
The Platformer Starter Kit is a near-complete, self-contained game solution that includes both game code and game assets. The game is a standard 2D platformer with levels, enemies, and collectable gems.
39+
\nThis sample is also available as a full cross-platform project template `mg2dstartkit`.
40+
</p>
41+
<p class="mt-auto">Check out the Platformer sample</p>
42+
</div>
43+
</a>
44+
</div>
45+
</div>
46+
<div class="col-12 col-lg-4 mb-5">
47+
<div class="mg-card mg-box-shadow h-100">
48+
<a target="_self"
49+
href="https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/NeonShooter"
50+
class="mg-no-link">
51+
<div class="mg-card-body d-flex flex-column h-100">
52+
<div class="mg-card-title"><i class="bi bi-battery-charging"></i> NeonShooter Sample 2D</div>
53+
<p>
54+
This project shows you how to make a Geometry Wars-inspired twin-stick shooter, with neon graphics, crazy particle effects, and awesome music.
55+
</p>
56+
<p class="mt-auto">Check out the NeonShooter sample</p>
57+
</div>
58+
</a>
59+
</div>
60+
</div>
61+
</div>
62+
</section>
63+
64+
## 3D Samples
65+
66+
<section class="container-xxl mb-5">
67+
<div class="row">
68+
<div class="col-12 col-lg-4 mb-5">
69+
<div class="mg-card mg-box-shadow h-100">
70+
<a target="_self"
71+
href="https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/FuelCell"
72+
class="mg-no-link">
73+
<div class="mg-card-body d-flex flex-column h-100">
74+
<div class="mg-card-title"><i class="bi bi-bandaid-fill"></i> FuelCell Sample 3D</div>
75+
<p>
76+
FuelCell is designed around a central concept providing basic gameplay mechanisms that are easily extensible. The FUelCell sample also includes a complete developer diary documenting its construction.
77+
</p>
78+
<p class="mt-auto">Click to view 3D FuelCell sample</p>
79+
</div>
80+
</a>
81+
</div>
82+
</div>
83+
<div class="col-12 col-lg-4 mb-5">
84+
<div class="mg-card mg-box-shadow h-100">
85+
<a target="_self"
86+
href="https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/ShipGame"
87+
class="mg-no-link">
88+
<div class="mg-card-body d-flex flex-column h-100">
89+
<div class="mg-card-title"><i class="bi bi-rocket-takeoff-fill"></i> ShipGame Sample 3D</div>
90+
<p>
91+
Ship Game is a 3D spaceship combat game set inside a complex tunnel system featuring advanced lighting and textures, a full GPU particle system, and physics.
92+
</p>
93+
<p class="mt-auto">Click to view 3D ShipGame sample</p>
94+
</div>
95+
</a>
96+
</div>
97+
</div>
98+
<div class="col-12 col-lg-4 mb-5">
99+
<div class="mg-card mg-box-shadow h-100">
100+
<a target="_self"
101+
href="/articles/samples.html"
102+
class="mg-no-link">
103+
<div class="mg-card-body d-flex flex-column h-100">
104+
<div class="mg-card-title"><i class="bi bi-lightbulb"></i> Coming Soon</div>
105+
<p>
106+
More 3D sample projects coming soon.
107+
</p>
108+
<p class="mt-auto">See what is coming</p>
109+
</div>
110+
</a>
111+
</div>
112+
</div>
113+
</div>
114+
</section>
115+
116+
## Community delivered full sample projects
117+
118+
<section class="container-xxl mb-5">
119+
<div class="row">
120+
<div class="col-12 col-lg-4 mb-5">
121+
<div class="mg-card mg-box-shadow h-100">
122+
<a target="_self"
123+
href="https://github.com/FlyingOakGames/GreedyKid"
124+
class="mg-no-link">
125+
<div class="mg-card-body d-flex flex-column h-100">
126+
<div class="mg-card-title"><i class="bi bi-files"></i> GreedyKid</div>
127+
<p>
128+
The repository for "Boo! Greedy Kid" on all platforms (Windows, macOS, and Linux) and its level editor (Windows-only).
129+
</p>
130+
<p class="mt-auto">Click to browse the GreedyKid Source</p>
131+
</div>
132+
</a>
133+
</div>
134+
</div>
135+
<div class="col-12 col-lg-4 mb-5">
136+
<div class="mg-card mg-box-shadow h-100">
137+
<a target="_self"
138+
href="https://github.com/ZenithMoonStudios/OldSchoolAdventure"
139+
class="mg-no-link">
140+
<div class="mg-card-body d-flex flex-column h-100">
141+
<div class="mg-card-title"><i class="bi bi-badge-ad-fill"></i> Old School Adventure</div>
142+
<p>
143+
The repository for "Old School Adventure" which was originally published using XNA on Xbox (XBLIG) and Windows Phone.
144+
</p>
145+
<p class="mt-auto">Click to browse the Old School Adventure Source</p>
146+
</div>
147+
</a>
148+
</div>
149+
</div>
150+
<div class="col-12 col-lg-4 mb-5">
151+
<div class="mg-card mg-box-shadow h-100">
152+
<a target="_self"
153+
href="/articles/samples.html"
154+
class="mg-no-link">
155+
<div class="mg-card-body d-flex flex-column h-100">
156+
<div class="mg-card-title"><i class="bi bi-lightbulb"></i> Coming Soon</div>
157+
<p>
158+
More full sample projects coming soon.
159+
</p>
160+
<p class="mt-auto">See what is coming</p>
161+
</div>
162+
</a>
163+
</div>
164+
</div>
165+
</div>
166+
</section>
15167

16-
### 2D Samples
17-
18-
- [AutoPong](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/AutoPong)
19-
- [Platformer 2D](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/Platformer2D)
20-
- [NeonShooter](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/NeonShooter)
21-
22-
### 3D Samples
168+
## Official MonoGame tutorial source
23169

24-
- [FuelCell](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/NeonShooter)
25-
- [ShipGame](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/ShipGame)
170+
- [Building 2D Games](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.4/Tutorials/learn-monogame-2d)
26171

27172
## XNA Game Studio Archive
28173

articles/tutorials/building_2d_games/04_creating_a_class_library/snippets/core.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Core(string title, int width, int height, bool fullScreen)
6666
// Set the window title
6767
Window.Title = title;
6868

69-
// Set the core's content manager to a reference of hte base Game's
69+
// Set the core's content manager to a reference of the base Game's
7070
// content manager.
7171
Content = base.Content;
7272

@@ -88,4 +88,4 @@ protected override void Initialize()
8888
// Create the sprite batch instance.
8989
SpriteBatch = new SpriteBatch(GraphicsDevice);
9090
}
91-
}
91+
}

articles/tutorials/building_2d_games/05_content_pipeline/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To open the *Content.mgcb* content project file in the MGCB Editor using the dot
5959
2. Enter the following dotnet CLI command
6060

6161
```sh
62-
dotnet mgcb-editor ./Content/Content.mgcb`
62+
dotnet mgcb-editor ./Content/Content.mgcb
6363
```
6464

6565
---

articles/tutorials/building_2d_games/07_optimizing_texture_rendering/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ These methods serve different purposes in managing the texture atlas:
162162

163163
## Using the TextureAtlas Class
164164

165-
No we can put our new `TextureAtlas` class to use by exploring two approaches; creating an atlas manually and using XML configuration. So far, we have been practicing using textures with the MonoGame logo. Now we will use a new texture atlas that contains various sprites we will need for our game.
165+
Now we can put our new `TextureAtlas` class to use by exploring two approaches; creating an atlas manually and using XML configuration. So far, we have been practicing using textures with the MonoGame logo. Now we will use a new texture atlas that contains various sprites we will need for our game.
166166

167167
Download the texture atlas by right-clicking the following image and saving it as atlas.png:
168168

articles/tutorials/building_2d_games/07_optimizing_texture_rendering/snippets/textureregion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public TextureRegion() { }
4646
/// </summary>
4747
/// <param name="texture">The texture to use as the source texture for this texture region.</param>
4848
/// <param name="x">The x-coordinate position of the upper-left corner of this texture region relative to the upper-left corner of the source texture.</param>
49-
/// <param name="y"><The y-coordinate position of the upper-left corner of this texture region relative to the upper-left corner of the source texture./param>
49+
/// <param name="y">The y-coordinate position of the upper-left corner of this texture region relative to the upper-left corner of the source texture.</param>
5050
/// <param name="width">The width, in pixels, of this texture region.</param>
5151
/// <param name="height">The height, in pixels, of this texture region.</param>
5252
public TextureRegion(Texture2D texture, int x, int y, int width, int height)

articles/tutorials/building_2d_games/11_input_management/snippets/core.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public Core(string title, int width, int height, bool fullScreen)
7878
// Set the window title
7979
Window.Title = title;
8080

81-
// Set the core's content manager to a reference of hte base Game's
81+
// Set the core's content manager to a reference of the base Game's
8282
// content manager.
8383
Content = base.Content;
8484

@@ -116,4 +116,4 @@ protected override void Update(GameTime gameTime)
116116

117117
base.Update(gameTime);
118118
}
119-
}
119+
}

articles/tutorials/building_2d_games/13_working_with_tilemaps/snippets/tilemap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public TextureRegion GetTile(int index)
108108
/// column and row.
109109
/// </summary>
110110
/// <param name="column">The column of the tile in this tilemap.</param>
111-
/// <param name="row">The row of hte tile in this tilemap.</param>
111+
/// <param name="row">The row of the tile in this tilemap.</param>
112112
/// <returns>The texture region of the tile from this tilemap at the specified column and row.</returns>
113113
public TextureRegion GetTile(int column, int row)
114114
{

articles/tutorials/building_2d_games/15_audio_controller/snippets/core.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Core(string title, int width, int height, bool fullScreen)
8484
// Set the window title
8585
Window.Title = title;
8686

87-
// Set the core's content manager to a reference of hte base Game's
87+
// Set the core's content manager to a reference of the base Game's
8888
// content manager.
8989
Content = base.Content;
9090

@@ -136,4 +136,4 @@ protected override void Update(GameTime gameTime)
136136

137137
base.Update(gameTime);
138138
}
139-
}
139+
}

articles/tutorials/building_2d_games/16_working_with_spritefonts/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ Next, open the *04B_30.spritefont* file in your code editor and make the followi
210210

211211
The key changes here are:
212212

213-
1. The `<FontName>` element was updated to `04B_11.ttf`, the exact filename with extension of the TTF font we just downloaded.
214-
2. The `<Size>` element was updated to be `32`.
213+
1. The `<FontName>` element was updated to `04B_30.ttf`, the exact filename with extension of the TTF font we just downloaded.
214+
2. The `<Size>` element was updated to be `17.5`.
215215

216216
### Updating the Game
217217

0 commit comments

Comments
 (0)