Skip to content
Robert Campbell edited this page Jul 31, 2023 · 4 revisions

The latest version of Ultraviolet is provided as a set of .NET Standard 2.1 libraries which are compatible with .NET 6 running on the Windows, Linux, and macOS platforms. As a prerequisite to the steps below, make sure that you have the .NET 6 SDK installed on your system.

Installing the dotnet new Templates

Ultraviolet provides dotnet new templates for easily creating new projects. You can install these templates from NuGet using the dotnet command line tool on .NET 6:

dotnet new -i Ultraviolet.Templates

If you are using .NET 7 or greater, use:

dotnet new install Ultraviolet.Templates

Creating a New Project

Once the templates are installed, creating a new project is simple. Run the following command:

dotnet new UvGame -n MyProjectName --developer "My Developer Name" --application "My Application Name"

This will generate the project structure in the MyProjectName directory. By default, two projects are created: a shared project which contains your game's code, and a .NET 6 project which can be compiled into an executable. You can request that the template should create an additional project for Android by using the --include-android parameter, i.e.

dotnet new UvGame -n MyProjectName --developer "My Developer Name" --application "My Application Name" --include-android true

Compiling and running the Android project requires Xamarin.

If you want to set up a project using the Ultraviolet Presentation Foundation, you can use the UpfGame template instead of the UvGame template, i.e.:

dotnet new UpfGame -n MyProjectName --developer "My Developer Name" --application "My Application Name" --include-android true

Running the Project

To run the project, make sure you're in the MyProjectName directory which you created earlier and run the following command:

dotnet run --project MyProjectName.NETCore\MyProjectName.NETCore.csproj

This will run the MyProjectName.NETCore project, which should display an Ultraviolet window.

Clone this wiki locally