-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/simondarksidej/itemtemplates #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...rp/content/MonoGame.ItemTemplate.Pipeline.Extension.CSharp/.template.config/template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| }, | ||
| "description": "A MonoGame content pipeline extension item." | ||
| } | ||
12 changes: 12 additions & 0 deletions
12
CSharp/content/MonoGame.ItemTemplate.Pipeline.Extension.CSharp/MG-Importer.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
|
SimonDarksideJ marked this conversation as resolved.
|
||
| } | ||
| } | ||
13 changes: 13 additions & 0 deletions
13
CSharp/content/MonoGame.ItemTemplate.Pipeline.Extension.CSharp/MG-Processor.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
|
SimonDarksideJ marked this conversation as resolved.
|
||
| } | ||
| } | ||
41 changes: 41 additions & 0 deletions
41
CSharp/content/MonoGame.ItemTemplate.SpriteFont.CSharp/.template.config/template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
86 changes: 86 additions & 0 deletions
86
CSharp/content/MonoGame.ItemTemplate.SpriteFont.CSharp/MGSpriteFont.spritefont
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
|
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> </Start> | ||
| <End>þ</End> | ||
| </CharacterRegion> | ||
|
|
||
| <!-- Hiragana (U+3040 - U+309F) --> | ||
| <CharacterRegion> | ||
| <Start>぀</Start> | ||
| <End>ゟ</End> | ||
| </CharacterRegion> | ||
|
|
||
| <!-- Katakana (U+30A0 - U+30FF) --> | ||
| <CharacterRegion> | ||
| <Start>゠</Start> | ||
| <End>ヿ</End> | ||
| </CharacterRegion> | ||
|
|
||
| <!-- Common Kanji (CJK Unified Ideographs - typically U+4E00 to U+9FFF) --> | ||
| <CharacterRegion> | ||
| <Start>一</Start> | ||
| <End>龯</End> | ||
| </CharacterRegion> | ||
|
|
||
| <!-- Cyrillic Character Set --> | ||
| <CharacterRegion> | ||
| <Start>А</Start> | ||
| <End>я</End> | ||
| </CharacterRegion> | ||
| </CharacterRegions> | ||
| </Asset> | ||
| </XnaContent> | ||
Binary file added
BIN
+163 KB
CSharp/content/MonoGame.ItemTemplate.SpriteFont.CSharp/Roboto-Bold.ttf
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | | ||
|
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] | ||
|
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. | ||
|
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. | ||
|
SimonDarksideJ marked this conversation as resolved.
|
||
| > | ||
| > E.G. | ||
| > `dotnet new mgpipelineitem -n {SomeName} -o {SomeFolderName}` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.