Skip to content
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

Add Multi-Platform 2D StartKit #3

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
93b8745
Migration of 2D StartKit to this repo.
CartBlanche Dec 4, 2024
3119de4
Fix HUD rendering, so it's consistent on all platforms.
CartBlanche Dec 4, 2024
51e73d2
Fix line endings on missed files.
CartBlanche Dec 4, 2024
628764c
Centralise HUD inside the level. Make backpack clickable on Mobile to…
CartBlanche Dec 5, 2024
e989d65
Add clickable text buttons that are only shown for mobile, so they ca…
CartBlanche Dec 6, 2024
a19c2f1
Fix rendering bugs.
CartBlanche Dec 7, 2024
fbd2c18
Initial commit for Blank 2D StartKit.
CartBlanche Dec 7, 2024
6946fbb
Use inverse of global transformation to correctly map inputs to curso…
CartBlanche Dec 7, 2024
95f1bdf
[Blank] Use inverse of global transformation to correctly map inputs …
CartBlanche Dec 7, 2024
e11f58b
[Blank]Trim it down a bit more
CartBlanche Dec 11, 2024
01c2e00
[Blank]Fix Mouse Clicking and add some defensive code around grabbing…
CartBlanche Dec 11, 2024
a7173c4
Fix Android Icon transparentcy and add min and max versions.
CartBlanche Dec 12, 2024
a7e156e
Standardise on using Roboto-Bold.ttf for our samples and templates.
CartBlanche Dec 12, 2024
aa150d0
Snsure iOS asset catalog creation builds with zero errors.
CartBlanche Dec 13, 2024
2508f2e
Generate levels for each Android asset and use recommended locations.
CartBlanche Dec 13, 2024
51de7df
Make sure we only have iPhone related entries in the asset catalog. A…
CartBlanche Dec 14, 2024
a43f0a7
Added ChatGPT generated icon.
CartBlanche Dec 17, 2024
f112a96
Update Icon files.
CartBlanche Dec 17, 2024
1e09756
Update Android and iOS icons.
CartBlanche Dec 17, 2024
0c758f1
[Desktop]Fix MouseClick bug
CartBlanche Dec 18, 2024
1ec3ad0
Standardise csprojs a little more.
CartBlanche Jan 2, 2025
3f01053
A little more clean-up
CartBlanche Jan 2, 2025
510dd36
More csproj tidy-up
CartBlanche Jan 2, 2025
2b59f00
sln tidy up.
CartBlanche Jan 2, 2025
7a80a66
[Blank] Tidy up localization files.
CartBlanche Jan 8, 2025
f0a3844
[Blank] Removed leaderboard reference.
CartBlanche Jan 8, 2025
5bdbf4a
[Both] Add method comments to all Program/MainActivity.cs files. Also…
CartBlanche Jan 8, 2025
c918787
[Blank] Document Settings files.
CartBlanche Jan 8, 2025
8a5aa47
Add documentation to the Screen classes.
CartBlanche Jan 8, 2025
99a8710
Use shared font instead of loading it again.
CartBlanche Jan 8, 2025
a4bda12
Document ScreenManager.
CartBlanche Jan 8, 2025
da29dfb
Document Localization
CartBlanche Jan 8, 2025
f5988d1
Document Inputs
CartBlanche Jan 9, 2025
2130438
[Blacnk] Document Effects
CartBlanche Jan 9, 2025
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,36 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-mgcb": {
"version": "3.8.2.1105",
"commands": [
"mgcb"
]
},
"dotnet-mgcb-editor": {
"version": "3.8.2.1105",
"commands": [
"mgcb-editor"
]
},
"dotnet-mgcb-editor-linux": {
"version": "3.8.2.1105",
"commands": [
"mgcb-editor-linux"
]
},
"dotnet-mgcb-editor-windows": {
"version": "3.8.2.1105",
"commands": [
"mgcb-editor-windows"
]
},
"dotnet-mgcb-editor-mac": {
"version": "3.8.2.1105",
"commands": [
"mgcb-editor-mac"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "MonoGame Team",
"classifications": [
"MonoGame", "Games", "Mobile", "Android", "iOS", "Desktop", "Windows", "Linux", "macOS"
],
"name": "MonoGame 2D StartKit",
"identity": "MonoGame.2D.StartKit",
"groupIdentity": "MonoGame.2D.StartKit",
"shortName": "mg2dstartkit",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "___SafeGameName___",
"preferNameDirectory": true,
"description": "A 2D MonoGame solution for all supported Mobile and Desktop platforms.",
"postActions": [
{
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [
{
"text": "Run 'dotnet restore'"
}
],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.companyname.___SafeGameName___" android:versionCode="1" android:versionName="1.0">
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="34" />
<application android:label="@string/app_name" android:icon="@drawable/icon" android:theme="@style/MainTheme" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;

using Microsoft.Xna.Framework;

using ___SafeGameName___.Core;

namespace ___SafeGameName___.Android;

[Activity(
Label = "___SafeGameName___",
MainLauncher = true,
Icon = "@drawable/icon",
Theme = "@style/Theme.Splash",
AlwaysRetainTaskState = true,
LaunchMode = LaunchMode.SingleInstance,
ScreenOrientation = ScreenOrientation.SensorLandscape,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden
)]
public class MainActivity : AndroidGameActivity
{
private ___SafeGameName___Game _game;
private View _view;

/// <summary>
/// Called when the activity is first created. Initializes the game instance,
/// retrieves its rendering view, and sets it as the content view of the activity.
/// Finally, starts the game loop.
/// </summary>
/// <param name="bundle">A Bundle containing the activity's previously saved state, if any.</param>
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

_game = new ___SafeGameName___Game();
_view = _game.Services.GetService(typeof(View)) as View;

SetContentView(_view);
_game.Run();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Splash" parent="android:Theme">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="MainTheme">
<!-- Set theme colors from https://aka.ms/material-colors -->
<!-- colorPrimary is used for the default action bar background -->
<!--<item name="colorPrimary">#2196F3</item>-->
<!-- colorPrimaryDark is used for the status bar -->
<!--<item name="colorPrimaryDark">#1976D2</item>-->
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<!--<item name="colorAccent">#FF4081</item>-->
</style>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">___SafeGameName___</string>
</resources>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#9ACEEB</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">___SafeGameName___</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>29</SupportedOSPlatformVersion>
<ApplicationId>com.companyname.___SafeGameName___</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<AssemblyName>___SafeGameName___</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<CreatePackage>false</CreatePackage>
<DefineConstants>$(DefineConstants);</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<CreatePackage>true</CreatePackage>
<DefineConstants>$(DefineConstants);</DefineConstants>
</PropertyGroup>
<ItemGroup>
<MonoGameContentReference Include="..\___SafeGameName___.Core\Content\___SafeGameName___.mgcb">
<Link>Content\___SafeGameName___.mgcb</Link>
</MonoGameContentReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\___SafeGameName___.Core\___SafeGameName___.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.*" />
<PackageReference Include="MonoGame.Framework.Android" Version="3.8.*" />
</ItemGroup>
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
<Message Text="Restoring dotnet tools" Importance="High" />
<Exec Command="dotnet tool restore" />
</Target>
</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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>

<!--
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.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
....................
....................
....................
....................
...............2....
..............###...
....................
....................
.........###........
....................
.....1..............
....#;#.............
....................
........P.......X...
####################
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
....................
....................
............X.......
......########......
..2.................
####............####
....................
....................
.......------.......
...--...........--..
.1................1.
#;##............####
....................
.P..................
####################
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
....................
P...................
......########......
....##........##....
..##............--..
.#...2..............
.#...#....X.........
.#........#######-..
#.##..........##...#
....##1....A##....#.
......###;###....#..
................#...
....................
....................
####################
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
....................
......P.....A3......
.....#########......
....#.........#2....
...#.....3.....#1...
..#.....---.....#...
..#..B......C...#...
#.#######;#######..#
..#.............#...
..#.............#...
.-#........X....#-..
.......#####........
#.................##
....B........A......
####################
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
....................
#..................#
...##1........1##...
...###2......2###...
..#####3....3#####..
...##.##....##.##...
...##..#3.DX#..##...
#..##...####...##..#
P..##..........##...
...##..........##...
..###....121...###..
........####........
....................
........A.......B...
####################
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
....................
........12221.......
#..##############...
...##...............
...##...............
P..##A..B..3.C..D...
..###############...
...##...............
...##...............
...##.1..1..1..1....
#..##############...
...................X
...................#
....B.........C.....
#########.##########
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading