Skip to content

Commit 8beaf0c

Browse files
authored
Merge branch 'main' into MusicAndSoundEffectsLabelAddedToSliders
2 parents 10cb46c + ddd762a commit 8beaf0c

File tree

13 files changed

+773
-58
lines changed

13 files changed

+773
-58
lines changed

articles/getting_started/1_setting_up_your_os_for_development_macos.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ If you intend to also work with platforms such as `Android` or `iOS`, you will n
3636
```
3737

3838
### [Maui](#tab/maui)
39+
3940
```cli
4041
dotnet workload install maui
4142
```
@@ -51,14 +52,6 @@ If you intend to also work with platforms such as `Android` or `iOS`, you will n
5152
> [!NOTE]
5253
> You can use `dotnet workload search` to detect any other available workloads you wish to use.
5354
54-
## Apple Silicon Known Issues
55-
56-
For the time being, MonoGame requires that you install the x64 version of the .NET runtime if you are running on an Apple Silicon mac in order to be able to build content. It is also required that [Rosetta](https://support.apple.com/en-us/HT211861) is enabled.
57-
58-
1. Navigate to [https://dotnet.microsoft.com/en-us/download/dotnet/9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
59-
1. Download the .NET Runtime Installer for macOS x64
60-
1. Once the **.pkg** file finishes downloading, run it and follow the prompts to install the .NET Runtime
61-
6255
## Setup Wine For Effect Compilation
6356

6457
Effect (shader) compilation requires access to DirectX. This means it will not work natively on macOS and Linux systems, but it can be used through [Wine](https://www.winehq.org/).

articles/getting_started/1_setting_up_your_os_for_development_ubuntu.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ If you intend to also work with platforms such as `Android` or `iOS`, you will n
3737
```
3838

3939
### [Maui](#tab/maui)
40+
4041
```cli
4142
dotnet workload install maui
4243
```

articles/getting_started/1_setting_up_your_os_for_development_windows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ If you intend to also work with platforms such as `Android` or `iOS`, you will n
4242
```
4343

4444
### [Maui](#tab/maui)
45+
4546
```cli
4647
dotnet workload install maui
4748
```

articles/getting_started/content_pipeline/automating_content_builder.md

Lines changed: 532 additions & 0 deletions
Large diffs are not rendered by default.

articles/getting_started/content_pipeline/content_builder_project.md

Lines changed: 140 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use the newest approach to building content in MonoGam
44
---
55

66
> [!NOTE]
7-
> These intructions **REQUIRE** you to use the latest `MonoGame Develop` release (currently `3.8.5-develop.13)
7+
> These instructions **REQUIRE** you to use the latest `MonoGame Develop` release (currently `3.8.5-develop.13`)
88
>
99
> See the [instructions here](https://docs.monogame.net/articles/getting_to_know/howto/HowTo_Install_Preview_Release.html) for how to install the preview project templates and update your project to use `3.8.5-develop` (preview) releases.
1010
>
@@ -117,7 +117,7 @@ MyContentBuilder/
117117

118118
This is the default (recommended) layout for a Content Builder project, but you can customize its use how you wish:
119119

120-
- There is single "entry point" (command line launch point) contained in the `builder.cs` which contains all the instructions to build content.
120+
- There is a single "entry point" (command line launch point) contained in the `builder.cs` which contains all the instructions to build content.
121121
- A default `Assets` folder to host your content, but your content can be in any location you need it to be, simply update the parameters used to run the console application to point to the source directory and folder for your content.
122122

123123
> [!TIP]
@@ -177,6 +177,70 @@ You should not need to touch anything else.
177177
>
178178
> See the [MS Documentation on Built targets](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-targets) for reference.
179179
180+
## Platform specific additions - Android / iOS
181+
182+
For platforms where the content is required to be packaged inside the output bundle, there are some additional steps required to ensure the built content is included during the Build/Publish step.
183+
184+
Each platform has specific requirements and requires the built content to be available prior to processing the project itself.
185+
186+
> [!NOTE]
187+
> Also check out the dedicated [Packaging Games advice](../packaging_games.md) published by the MonoGame team.
188+
189+
### Android
190+
191+
For Android, a specific `Include` section is needed in the project's `csproj` project definition, as follows:
192+
193+
> [!NOTE]
194+
> Android uses a special `AndroidAsset` tag to identify content to include.
195+
196+
```xml
197+
<ItemGroup>
198+
<AndroidAsset Include="$(OutputPath)Content\**\*">
199+
<Link>Content\%(RecursiveDir)%(Filename)%(Extension)</Link>
200+
</AndroidAsset>
201+
</ItemGroup>
202+
```
203+
204+
> [!NOTE]
205+
> If you change the location where the Content Builder project outputs content to, the paths above will need to be updated to the new location to find the content to include.
206+
207+
At build time, the "BuildContent" task will run and execute the Content Builder, then with the output from the builder, the Android solution will automatically identify and package the content as per Google's packaging requirements, generating an `APK` for sideloading and an `AAB` for publishing to the Google Play Store.
208+
209+
> [!NOTE]
210+
> If your content is too large to fit within the maximum size of the base application, you will need to use Asset Bundles to package your content, as demonstrated here:
211+
>
212+
> ```xml
213+
> <ItemGroup>
214+
> <AndroidAsset Include="$(OutputPath)Content\**\*">
215+
> <Link>Content\%(RecursiveDir)%(Filename)%(Extension)</Link>
216+
> </AndroidAsset>
217+
> <AndroidAsset Update="Content\Path\SomeLargeFile.xnb" AssetPack="foo" />
218+
> </ItemGroup>
219+
>
220+
> However, your game project will also need to be aware and update its strategy for loading the content to take the asset packs into account.
221+
>
222+
> For more details, see the [Microsoft Documentation](https://devblogs.microsoft.com/dotnet/android-asset-packs-in-dotnet-android/).
223+
224+
### iOS
225+
226+
For iOS, a specific `Include` section is needed in the project's `csproj` project definition, as follows:
227+
228+
> [!NOTE]
229+
> iOS uses a special `BundleResource` tag to identify content to include.
230+
231+
```xml
232+
<ItemGroup>
233+
<BundleResource Include="$(OutputPath)Content\**\*">
234+
<Link>Content\%(RecursiveDir)%(Filename)%(Extension)</Link>
235+
</BundleResource >
236+
</ItemGroup>
237+
```
238+
239+
> [!NOTE]
240+
> If you change the location where the Content Builder project outputs content to, the paths above will need to be updated to the new location to find the content to include.
241+
242+
At build time, the "BuildContent" task will run and execute the Content Builder, then with the output from the builder, the Android solution will automatically identify and package the content within the App as per Apple's packaging standards.
243+
180244
## Basic Builder Project Structure
181245

182246
The default `Builder.cs` file looks like this, which contains everything needed to build all content in the designated Assets/Content folder using the default [Importers and Processors](/articles/getting_to_know/whatis/content_pipeline/CP_StdImpsProcs) (how MonoGame compiles content) into processed `.XNB` files for consumption by your runtime project:
@@ -224,7 +288,7 @@ The default `Include` rule simply builds a list of content to process from the t
224288

225289
### Core Properties
226290

227-
Here are the main properties available work with:
291+
Here are the main properties available to work with:
228292

229293
| Property | Description | Default Value |
230294
|----------|-------------|---------------|
@@ -561,7 +625,7 @@ contentCollection.Include("explosion.wav", audioImporter, audioProcessor);
561625
> [!NOTE]
562626
> As can be seen in the updated examples using the new Content Builder Project system, this can also be simplified to just:
563627
>
564-
> `contentCollection.Include("hero.png", new TextureImporter(), new TextureProcessor());
628+
> `contentCollection.Include("hero.png", new TextureImporter(), new TextureProcessor());`
565629
>
566630
> It just depends on which pattern you are more comfortable with.
567631
@@ -589,6 +653,27 @@ contentCollection.Include<WildcardRule>(
589653
);
590654
```
591655

656+
### Handling Custom Importer / Processor caching
657+
658+
The caching validation process that determines whether the Content Builder re-processes content by default is decided by:
659+
660+
- The comparison between the last state of the built asset and the source
661+
- It will also take into account the "Version" of the Content Importer and Processor that was used at the time the content was built.
662+
663+
The cache is only invalidated when either of these conditions are met, else it will skip over processing of the asset for performance as it has not detected a change.
664+
665+
> [!NOTE]
666+
> MonoGame manages the versions of the [built-in Importers and Processors](../../getting_to_know/whatis/content_pipeline/CP_StdImpsProcs.md), so unless MonoGame makes changes to these elements, the cache will not be invalidated unless you [Force a rebuild](#understanding-contentbuilderparams).
667+
668+
If you want content to be rebuilt when a Custom Importer or Processor has changed (content that uses the custom entities in its builder configuration), then the version of the Custom Content Pipeline Extension has to change, to do this, simply update the "Version" property on the respective Importer or Processor as follows:
669+
670+
```csharp
671+
public override string Version { get; set; } = "new Version";
672+
```
673+
674+
> [!NOTE]
675+
> The version can be anything you like, so long as it is a recognisable and readable string. Preferably something you can increment.
676+
592677
### Configuring Processor Parameters
593678

594679
Many processors have configurable parameters that control how they process content. If you need to override these parameters with specific values, here is how to customize them:
@@ -651,6 +736,8 @@ contentCollection.Include<WildcardRule>(
651736

652737
## Advanced Scenarios
653738

739+
The following scenarios are of a more advanced nature for scenarios where you need specific customisation to suit your delivery needs.
740+
654741
### Scenario 1: Platform-Specific Content
655742

656743
Build different content for different platforms:
@@ -714,7 +801,52 @@ public override IContentCollection GetContentCollection()
714801
}
715802
```
716803

717-
### Scenario 3: Debugging the Builder
804+
### Scenario 3: Dynamic Content from External Sources
805+
806+
Process content from multiple sources:
807+
808+
```csharp
809+
public override IContentCollection GetContentCollection()
810+
{
811+
var contentCollection = new ContentCollection();
812+
813+
// Base game content
814+
contentCollection.Include<WildcardRule>("BaseGame/*");
815+
816+
// DLC content (if available)
817+
var dlcPath = Path.Combine(Parameters.RootedSourceDirectory, "DLC");
818+
if (Directory.Exists(dlcPath))
819+
{
820+
contentCollection.SetContentRoot("DLC");
821+
contentCollection.Include<WildcardRule>("DLC/*");
822+
}
823+
824+
// Mod content (if available)
825+
var modPath = Path.Combine(Parameters.RootedSourceDirectory, "Mods");
826+
if (Directory.Exists(modPath))
827+
{
828+
contentCollection.SetContentRoot("Mods");
829+
contentCollection.Include<WildcardRule>("Mods/*");
830+
}
831+
832+
return contentCollection;
833+
}
834+
```
835+
836+
---
837+
838+
## Debugging
839+
840+
At times you might need to debug your Content Builder, and while you can just run it manually in debug mode and attach your IDE to it, sometimes it is also valuable to FORCE the application to pause and let you step through importing and processing, especially when working with Content Pipeline Extensions.
841+
842+
Alternatively, you may simply want to inject additional assets into your project for debugging purposes (such as overlays, etc) which are only consumed in a `Debug` build of your project (using `#if DEBUG` in your runtime too).
843+
844+
> [!NOTE]
845+
> This is a rather advanced area which for most situations you do not need to go to these lengths.
846+
847+
The following scenarios outline these options as they pertain to the Content Builder solution:
848+
849+
### Scenario 1: Debugging the Builder
718850

719851
If you wish to inject a `Debugger` breakpoint to determine the cause of any issues when building content, you can add the following before the `Builder` runs in your `ContentBuilder` project, this will cause DotNet to request to launch the default debugger and automatically attach it to the project when it is run:
720852

@@ -727,14 +859,15 @@ using System.Diagnostics;
727859
// this, build the game, then attach the debugger when prompted.
728860
#if DEBUG
729861
Debugger.Launch();
862+
#endif
730863

731864
// Launch point
732865
builder.Run(args);
733866
```
734867

735-
### Scenario 4: Conditional Debug Content
868+
### Scenario 2: Conditional Debug Content
736869

737-
Include extra content in debug builds:
870+
Useful when you need to include extra content in debug only builds for testing, e.g. texture overlays or additional fonts:
738871

739872
```csharp
740873
public override IContentCollection GetContentCollection()
@@ -754,38 +887,6 @@ public override IContentCollection GetContentCollection()
754887
}
755888
```
756889

757-
### Scenario 5: Dynamic Content from External Sources
758-
759-
Process content from multiple sources:
760-
761-
```csharp
762-
public override IContentCollection GetContentCollection()
763-
{
764-
var contentCollection = new ContentCollection();
765-
766-
// Base game content
767-
contentCollection.Include<WildcardRule>("BaseGame/*");
768-
769-
// DLC content (if available)
770-
var dlcPath = Path.Combine(Parameters.RootedSourceDirectory, "DLC");
771-
if (Directory.Exists(dlcPath))
772-
{
773-
contentCollection.SetContentRoot("DLC");
774-
contentCollection.Include<WildcardRule>("DLC/*");
775-
}
776-
777-
// Mod content (if available)
778-
var modPath = Path.Combine(Parameters.RootedSourceDirectory, "Mods");
779-
if (Directory.Exists(modPath))
780-
{
781-
contentCollection.SetContentRoot("Mods");
782-
contentCollection.Include<WildcardRule>("Mods/*");
783-
}
784-
785-
return contentCollection;
786-
}
787-
```
788-
789890
---
790891

791892
## Summary
31.4 KB
Loading
54.9 KB
Loading

articles/images/spritebatch.png

17.9 KB
Loading

articles/sponsors_access.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Sponsors Access
3+
description: Resources available exclusively to Sponsors of MonoGame.
4+
---
5+
6+
At MonoGame, we are working hard to evolve the framework, to provide fresh resources, tools, samples and content to assist all consumers of the MonoGame Framework.
7+
8+
## Requirements
9+
10+
The minimum sponsorship level required to access the private resources is [SpriteBatch](https://monogame.net/donate/)&nbsp;
11+
![SpriteBatch Logo](./images/spritebatch.png)
12+
13+
## Sponsors Resources
14+
15+
To both celebrate and reward Sponsors of MonoGame, we give you early access to the latest and greatest the team are currently working on, this includes:
16+
17+
### Tutorials
18+
19+
- Early access to the latest tutorial content:
20+
21+
- An Advanced 2D Shader tutorial - live
22+
- A Mobile Deployment tutorial - incoming
23+
- A Beginner 3D tutorial - incoming
24+
25+
### Samples
26+
27+
- Early access to new MonoGame Samples:
28+
29+
- The 3D Platformer sample - A migrated platformer sample from [Kenny.nl](https://www.kenney.nl/starter-kits)'s sample outfitted for MonoGame
30+
- The 3D FPS sample (incoming) - A migrated FPS sample from [Kenny.nl](https://www.kenney.nl/starter-kits)'s sample outfitted for MonoGame
31+
32+
> [!NOTE]
33+
> Early access is granted for several months before they become public.
34+
35+
We are also working hard on more resources for the community.
36+
37+
## DrawUserPrimitives exclusive content
38+
39+
![DrawUserPrimitives Logo](./images/drawuserprimitives.png)
40+
41+
Sponsors at DrawUserPrimitives and above also get additional resources:
42+
43+
- The 3D Ascent demo project - An upgraded version of the old [Ship Game](https://github.com/MonoGame/MonoGame.Samples/blob/3.8.4/ShipGame/README.md) sample, modernised for today's platforms.
44+
45+
## Accessing the Private Sponsorship site
46+
47+
The private sponsors only documentation site can be found at the following address:
48+
49+
### [https://sponsors.monogame.net/](https://sponsors.monogame.net/)
50+
51+
Access is granted through your GitHub account, once your sponsorship is confirmed, we will request your GitHub account name so we can assign it to the relevant sponsorship level.
52+
53+
## GitHub Authorisation
54+
55+
In order to verify your identity, GitHub will request you validate the first time you access the site with the following dialog:
56+
57+
![Sponsors site permission request](./images/sponsors_access.png)
58+
59+
### Authorization details
60+
61+
The Sponsors site application connects your GitHub account securely to our sponsorship system.
62+
By authorizing, you allow us to:
63+
64+
- ✅ Verify your GitHub identity (to confirm you are the correct sponsor)
65+
- ✅ Know which resources you can access (to match benefits to your sponsorship tier)
66+
- ✅ Act on your behalf (to confirm your sponsorship level, unlock exclusive content, and keep content access in sync)
67+
68+
### Why do we need this?
69+
70+
MonoGame needs to request permissions so we can:
71+
72+
- Link your sponsorship to your GitHub account
73+
- Provide you with exclusive sponsor benefits
74+
- Keep your access secure and personalized
75+
76+
### Security & Privacy
77+
78+
- We only request the **minimum permissions** required.
79+
- Your data is handled according to our [Privacy Policy](https://community.monogame.net/privacy).
80+
- You can revoke access anytime from your [GitHub Authorized Apps](https://github.com/settings/applications).
81+
82+
## Questions?
83+
84+
If you have concerns regarding the sponsorship site or the content within, please contact us at [[email protected]].

articles/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ items:
8181
href: getting_started/content_pipeline/why_content_pipeline.md
8282
- name: Using the Content Builder Project
8383
href: getting_started/content_pipeline/content_builder_project.md
84+
- name: Automating the Content Builder
85+
href: getting_started/content_pipeline/automating_content_builder.md
8486
- name: Using MGCB Editor
8587
href: getting_started/content_pipeline/using_mgcb_editor.md
8688
- name: Custom Effects

0 commit comments

Comments
 (0)