Chickensoft.Platform
1.3.0-godot4.4.0-rc.1
dotnet add package Chickensoft.Platform --version 1.3.0-godot4.4.0-rc.1
NuGet\Install-Package Chickensoft.Platform -Version 1.3.0-godot4.4.0-rc.1
<PackageReference Include="Chickensoft.Platform" Version="1.3.0-godot4.4.0-rc.1" />
paket add Chickensoft.Platform --version 1.3.0-godot4.4.0-rc.1
#r "nuget: Chickensoft.Platform, 1.3.0-godot4.4.0-rc.1"
// Install Chickensoft.Platform as a Cake Addin #addin nuget:?package=Chickensoft.Platform&version=1.3.0-godot4.4.0-rc.1&prerelease // Install Chickensoft.Platform as a Cake Tool #tool nuget:?package=Chickensoft.Platform&version=1.3.0-godot4.4.0-rc.1&prerelease
🧩 Platform
Platform-specific native extensions for Godot.
<p align="center"> <img alt="Platform" src="icon.png" width="200"> </p>
✅ Features
Platform provides a way to determine the actual scale factor and native resolution of the display that a Godot window is located on. Godot does not determine the actual scale factor and native resolution reliably on Windows and macOS, so we use various native API's to determine the true scale factor.
- ✅ Determine scale factor and native resolution on macOS.
- ✅ Determine scale factor and native resolution on Windows.
[!NOTE] You may be more interested in using GameTools, which uses this project to provide a high-level display-agnostic scaling API to help your game or app look consistent and scale correctly in multi-monitor mixed-DPI environments.
📦 Nuget Package Installation
dotnet add package Chickensoft.Platform --prerelease
Then, use it like so:
using Chickensoft.Platform;
// Use Win32 or CoreGraphics to get the display's actual resolution.
var resolution = Displays.Singleton.GetNativeResolution(window);
// Use Win32 or CoreGraphics to determine the display's actual scale factor.
var scale = Displays.Singleton.GetDisplayScaleFactor(window);
That's it!
🛠️ Building the Nuget Package
The nuget package project shares the same source code and can be built directly.
cd Chickensoft.Platform
dotnet build
It helps if you have read some of the relevant documentation:
- Microsoft: Building Native Libraries with NativeAOT
- Source generation for platform invokes (p/invoke)
There is a Godot sandbox project in sandbox/Chickensoft.Platform.SandboxRef
that you can run to test the library manually.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- GodotSharp (>= 4.4.0-rc.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Chickensoft.Platform:
Package | Downloads |
---|---|
Chickensoft.GameTools
A collection of tools for accelerating Godot + C# game development. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.0-godot4.4.0-rc.1 | 73 | 2/21/2025 |
1.2.0-godot4.4.0-beta.4 | 57 | 2/19/2025 |
1.1.0-godot4.4.0-beta.4 | 39 | 2/19/2025 |
1.0.0-godot4.4.0-dev.7 | 57 | 2/11/2025 |
0.6.0-godot4.4.0-dev.7 | 131 | 1/19/2025 |
Chickensoft.Platform release.