|
|
2 months ago | |
|---|---|---|
| .. | ||
| .config | 2 months ago | |
| .vscode | 2 months ago | |
| Core | 2 months ago | |
| Platforms | 2 months ago | |
| Orientation.sln | 2 months ago | |
| README.md | 2 months ago | |
This is a MonoGame 3.8.4 sample project that demonstrates orientation handling in games across multiple platforms. The sample shows how to handle different screen orientations and scaling in MonoGame applications.
This sample demonstrates:
net8.0-windowsnet8.0net8.0-androidnet8.0-ios/Core
MonoGame.Orientation.Core.csproj
OrientationSample.cs
LayoutSample.cs
/Platforms
/Windows
Orientation.Windows.csproj
Program.cs
/Desktop
Orientation.DesktopGL.csproj
Program.cs
/Android
Orientation.Android.csproj
MainActivity.cs
/iOS
Orientation.iOS.csproj
AppDelegate.cs
Main.cs
Assets/Content/ # Game content files (.xnb format)
Resources/ # Android resources
Properties/ # Platform-specific configuration files
Orientation.sln in Visual Studio 2022Ctrl+Shift+P → "Tasks: Run Task"# Build Windows version
cd Platforms/Windows
dotnet build Orientation.Windows.csproj
# Build DesktopGL version
cd ../Desktop
dotnet build Orientation.DesktopGL.csproj
# Build Android version
cd ../Android
dotnet build Orientation.Android.csproj
# Build iOS version
cd ../iOS
dotnet build Orientation.iOS.csproj
Simply run the executable or use dotnet run --project <csproj> with the appropriate project file.
Deploy to an Android device or emulator using Visual Studio or via command line:
cd Platforms/Android
dotnet build Orientation.Android.csproj -f net8.0-android
Deploy to an iOS device or simulator using Visual Studio for Mac or Xcode.
This project uses pre-built XNB content files located in Assets/Content/:
directions.xnb - Direction graphicsFont.xnb - Sprite font for text renderingAll dependencies are managed via NuGet package references in the project files.
This sample is based on Microsoft XNA Community Game Platform samples and is provided for educational purposes.