Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"author": "MonoGame Foundation",
"classifications": [
"MonoGame", "Games", "Extensions"
],
"name": "MonoGame Content Pipeline Extension",
"groupIdentity": "MonoGame.Library.Pipeline.Item",
"identity": "MonoGame.Library.Pipeline.Extension.Item.CSharp",
"shortName": "mgpipelineitem",
"tags": {
"language": "C#",
"type": "item"
},
"primaryOutputs": [
{
"path": "MG-Importer.cs"
},
{
"path": "MG-Processor.cs"
}
],
"sourceName": "MG",
"symbols": {
"ItemName": {
"type": "parameter",
"replaceInFilename": true
Comment thread
SimonDarksideJ marked this conversation as resolved.
}
},
"description": "A MonoGame content pipeline extension item."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.Xna.Framework.Content.Pipeline;

using TImport = System.String;

[ContentImporter(".txt", DisplayName = "MGImporter", DefaultProcessor = "MGProcessor")]
public class MGImporter : ContentImporter<TImport>
{
public override TImport Import(string filename, ContentImporterContext context)
{
return default(TImport);
Comment thread
SimonDarksideJ marked this conversation as resolved.
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.Xna.Framework.Content.Pipeline;

using TInput = System.String;
using TOutput = System.String;

[ContentProcessor(DisplayName = "MGProcessor")]
public class MGProcessor : ContentProcessor<TInput, TOutput>
{
public override TOutput Process(TInput input, ContentProcessorContext context)
{
return default(TOutput);
Comment thread
SimonDarksideJ marked this conversation as resolved.
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"author": "MonoGame Foundation",
"classifications": [
"MonoGame", "Games", "Content"
],
"name": "MonoGame SpriteFont Template",
"groupIdentity": "MonoGame.ContentTemplate",
"identity": "MonoGame.SpriteFont.CSharp",
"shortName": "mgsf",
"tags": {
"language": "C#",
"type": "item"
},
"primaryOutputs": [
{
"path": "MGSpriteFont.spritefont"
}
],
"sourceName": "MGSpriteFont",
"description": "A MonoGame SpriteFont item template for a Content Project.",
"symbols": {
"IncludeFont": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Include the default Roboto-Bold.ttf font file used in the template."
}
},
"sources": [
{
"modifiers": [
{
"condition": "(!IncludeFont)",
"exclude": [
"**/*.ttf"
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">

<!--
Modify this string to change the font that will be imported.
-->
<FontName>Roboto-Bold</FontName>

<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>14</Size>

<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>

<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>

<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
Comment thread
SimonDarksideJ marked this conversation as resolved.

<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->

<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 254, ('■'), covering the basic Latin
character set as well as extended character set.
The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<!-- Latin Character and Extended Set -->
<CharacterRegion>
<Start>&#32;</Start>
<End>&#254;</End>
</CharacterRegion>

<!-- Hiragana (U+3040 - U+309F) -->
<CharacterRegion>
<Start>&#12352;</Start>
<End>&#12447;</End>
</CharacterRegion>

<!-- Katakana (U+30A0 - U+30FF) -->
<CharacterRegion>
<Start>&#12448;</Start>
<End>&#12543;</End>
</CharacterRegion>

<!-- Common Kanji (CJK Unified Ideographs - typically U+4E00 to U+9FFF) -->
<CharacterRegion>
<Start>&#19968;</Start>
<End>&#40879;</End>
</CharacterRegion>

<!-- Cyrillic Character Set -->
<CharacterRegion>
<Start>&#1040;</Start>
<End>&#1103;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
Binary file not shown.
67 changes: 64 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# MonoGame.Templates
MonoGame repo to hold our project templates

# NOTE:
When creating your projects from these templates, using commands like `dotnet new mg2dstartkit -n {SomeName}` Do NOT use numbers as the 1st character of the name of your project. These will be replaced by underscores, `_`, and will break the templates.
MonoGame repo to hold our project/item templates.

## Project Templates

> [!NOTE]
>
> When creating your projects from these templates, use commands like `dotnet new mg2dstartkit -n {SomeName}`.

| Name | Short Code | Description |
| - | - | - |
| 2D StartKit | mg2dstartkit | A solution with a shared "Core" library and "Project" definitions for DesktopGL, iOS, and Android. |
| Blank 2D StartKit | mgblank2dstartkit | A complete solution, complete with content, with a shared "Core" library and "Project" definitions for DesktopGL, iOS, and Android. |
Comment thread
SimonDarksideJ marked this conversation as resolved.
| Android | mgandroid | A blank Android MonoGame project |
| Cross-Platform desktop | mgdesktopgl | A blank Desktop GL MonoGame project |
| iOS | mgios | A blank iOS MonoGame project |
| Windows DirectX11 | mgwindowsdx | A blank Windows DX11 MonoGame project |
| Game Library | mglib | A blank MonoGame class library project, including MG references. |
| Content Builder Project | mgcb | A template Content Builder project, with default Builder script and Assets folder. |
| Content Pipeline Extension | mgpipeline | A template Content Pipeline Extension project. |

> [!Note]
Comment thread
SimonDarksideJ marked this conversation as resolved.
> Legacy Templates
>
> - Shared Library - mgshared - Legacy Xamarin template.

## Preview Project Templates

| Name | Short Code | Description |
| - | - | - |
| Content Builder StartKit | mg2dmgcbstartkit | Demo project complete with solution and content. Includes new VK/DX12 targets. |
| Content Builder Blank StartKit | mgblankmgcbstartkit | Demo solution without content. Includes new VK/DX12 targets. |

## Rules for Project naming

You **MUST** follow the standard .NET conventions when naming projects:

- Do NOT use numbers as the 1st character of the name of your project. These will be replaced by underscores, `_`, and will break the templates.
- Do NOT begin with a special character
- Spaces are not allowed; they will be replaced with underscores, `_`, which will break the template.

## Item Templates

> [!NOTE]
>
> When creating your items from these templates, use commands like `dotnet new mgsf -n {SomeName}`.

| Name | Short Code | Description |
| - | - | - |
| Sprite Font template | mgsf | SpriteFont item template for Content Projects |
| Content Pipeline Extension | mgpipelineitem | A template Content Pipeline Extension Item set (importer/processor) |

> [!TIP]
>
> The SpriteFont template also includes a default Font file, to include it when creating an item, use the `--IncludeFont` argument.
>
> `dotnet new mgsf -n {SomeName} --IncludeFont`
>
> *Note this will error if the font file already exists in the directory.
Comment thread
SimonDarksideJ marked this conversation as resolved.

> [!TIP]
> We recommend when using the "Content Pipeline Extension" Item template, to also use the `-o` argument to place it in its own folder. Not mandatory.
Comment thread
SimonDarksideJ marked this conversation as resolved.
>
> E.G.
> `dotnet new mgpipelineitem -n {SomeName} -o {SomeFolderName}`