OTK.UI
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package OTK.UI --version 1.1.1
NuGet\Install-Package OTK.UI -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OTK.UI" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OTK.UI" Version="1.1.1" />
<PackageReference Include="OTK.UI" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OTK.UI --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OTK.UI, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OTK.UI@1.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OTK.UI&version=1.1.1
#tool nuget:?package=OTK.UI&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
OTK.UI
A cross platform UI library for OpenTK with embedded resource support.
Features
- Buttons, Sliders, Labels, Panels and more.
- UI layouts defined in XML.
- Asset agnostic. Works with both embedded and disk files.
- Compatible with OpenTK 4+.
Getting Started
- Clone or download the repository.
- Add OTK.UI as a project reference in your OpenTK project.
- Make sure your project has the necessary textures, fonts and XML layouts you wish to use in your user interface. OTK.UI does not come pre-packaged with those resources.
Dependencies
OTK.UI depends on a number of third party libraries.
- OpenTK version 4.9.4
- StbImageSharp version 2.30.15
- StbTrueTypeSharp version 1.26.12
- Syntellect.Typography.OpenFont.Net6 version 1.0.0
Make sure these dependencies are installed via NuGet in your project before using OTK.UI
Contributing
Contributions to OTK.UI are welcome. You can help by fixing bugs, adding features, improving documentation or providing example layouts
How to Contribute
- Fork the repository and clone it locally.
# Replace your_username with your GitHub username.
git clone https://github.com/your_username/otk.ui.git
cd OTK.UI
- Create a new branch for your changes
git checkout -b feature/my_change
- Make your changes
- Follow the existing code style
- Test embedded resources, layouts and UI components
- Update documentation as necessary
- Commit and Push your branch
git add .
git commit -m "Add a brief description of your changes here."
git push origin feature/my_change
- Open a Pull request against the main repository. Include a description of your changes and any relevant examples.
Reporting issues
- Report bugs or issues under the Issues tab with clear steps to reproduce.
- Feature requests and suggestions are welcome as well.
Example
Inside your custom GamePanel OnLoad method:
UIBase.Window = this;
TextureManager.LoadTexture("ButtonTexture.png");
FontManager.LoadFont("DefaultFont.ttf");
LayoutLoader loader = new LayoutLoader("LoadedLayout.xml");
var button = loader.Get<Button>("LoadedButton");
if (button is not null)
{
button.Released += (MouseButton) =>
{
UIBase.Window?.Close();
};
}
| 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- OpenTK (>= 4.9.4)
- StbImageSharp (>= 2.30.15)
- StbTrueTypeSharp (>= 1.26.12)
- Syntellect.Typography.OpenFont.Net6 (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.