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

Multi-platform StartKit #8275

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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.1.303",
"commands": [
"mgcb"
]
},
"dotnet-mgcb-editor": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor"
]
},
"dotnet-mgcb-editor-linux": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor-linux"
]
},
"dotnet-mgcb-editor-windows": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor-windows"
]
},
"dotnet-mgcb-editor-mac": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor-mac"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "MonoGame Team",
"classifications": [
"MonoGame", "Games", "Mobile",
],
"name": "MonoGame StartKit",
"identity": "MonoGame.StartKit",
"groupIdentity": "MonoGame.StartKit",
"shortName": "mg-startkit",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "$___safegamename___$",
"preferNameDirectory": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-dotnettools.csdevkit",
"ms-dotnettools.dotnet-maui",
"ms-dotnettools.vscodeintellicode-csharp",
"ms-vscode.mono-debug",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Android Debug",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 10000,
"preLaunchTask": "Debug Android Build",
},
{
"name": "DesktopGL Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Debug DesktopGL Build",
"program": "${workspaceFolder}/AutoPong.DesktopGL/bin/Debug/net8.0/AutoPong.DesktopGL.exe",
},
{
"name": "iOS Debug",
"type": "maui",
"request": "launch",
"preLaunchTask": "maui: Build",
},
{
"name": "WindowsDX Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Debug WindowsDX Build",
"program": "${workspaceFolder}/AutoPong.WindowsDX/bin/Debug/net8.0-windows/AutoPong.WindowsDX.exe",
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"terminal.integrated.defaultProfile.windows": "Command Prompt"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Debug Android Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.Android/AutoPong.Android.csproj \"/t:Install;_Run\" /p:AndroidAttachDebugger=true /p:AndroidSdbHostPort=10000",
},
{
"label": "Debug DesktopGL Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.DesktopGL/AutoPong.DesktopGL.csproj"
},
{
"label": "Debug iOS Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.iOS/AutoPong.iOS.csproj"
},
{
"label": "Debug WindowsDX Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.WindowsDX/AutoPong.WindowsDX.csproj"
},
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "MonoGame Team",
"classifications": [
"MonoGame", "Games", "Mobile", "Android"
],
"name": "MonoGame StartKit (Android)",
"identity": "MonoGame.StartKit.Android",
"groupIdentity": "MonoGame.StartKit",
"shortName": "mg-startkit-android",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "$___safegamename___$",
"preferNameDirectory": 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="___safegamename___.Android" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="34" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application android:label="___safegamename___"></application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//-----------------------------------------------------------------------------
// MainActivity.cs
//
// MonoGame Foundation Game Platform
// Copyright (C) MonoGame Foundation. All rights reserved.
//-----------------------------------------------------------------------------

#region Using Statements
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;

using Microsoft.Xna.Framework;

using ___safegamename___.Core;
#endregion

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;

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();
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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>
<string name="app_name">___safegamename___</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?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>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<ApplicationId>com.companyname.___safegamename___.Android</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
</PropertyGroup>
<ItemGroup>
<AndroidResource Include="Resources\Drawable\Splash.png" />
<AndroidResource Include="Resources\Values\Styles.xml" />
</ItemGroup>
<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.1.303" />
<PackageReference Include="MonoGame.Framework.Android" Version="3.8.1.303" />
</ItemGroup>
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
<Message Text="Restoring dotnet tools" Importance="High" />
<Exec Command="dotnet tool restore" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.Android",
"version": ""
}
],
"configProperties": {
"Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability": true,
"System.AggressiveAttributeTrimming": true,
"System.Diagnostics.Tracing.EventSource.IsSupported": false,
"System.Globalization.Invariant": false,
"System.Net.Http.EnableActivityPropagation": false,
"System.Net.Http.UseNativeHttpHandler": true,
"System.Reflection.NullabilityInfoContext.IsSupported": false,
"System.Runtime.InteropServices.BuiltInComInterop.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false,
"System.StartupHookProvider.IsSupported": false,
"System.Text.Encoding.EnableUnsafeUTF7Encoding": false,
"System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault": true,
"Xamarin.Android.Net.UseNegotiateAuthentication": false,
"Switch.System.Reflection.ForceInterpretedInvoke": true,
"Microsoft.Extensions.DependencyInjection.DisableDynamicEngine": true,
"System.Diagnostics.Metrics.Meter.IsSupported": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documents":{"C:\\Users\\savag\\source\\repos\\CartBlanche\\MonoGame\\MonoGame\\*":"https://raw.githubusercontent.com/MonoGame/MonoGame/86b4e803f4676cc94af7d9ed5427c640ce27fc80/*"}}