Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xapier14/cerulean

A cross-platform UI framework for C#.
https://github.com/xapier14/cerulean

c-sharp dotnet gui sdl2 xml

Last synced: about 7 hours ago
JSON representation

A cross-platform UI framework for C#.

Awesome Lists containing this project

README

        

Cerulean UI



Useful Tools

CLI Tool |
Layout Designer


Available on Nuget

![Nuget](https://img.shields.io/nuget/v/Cerulean.Core?label=Cerulean.Core) ![Nuget](https://img.shields.io/nuget/v/Cerulean.Common?label=Cerulean.Common) ![Nuget](https://img.shields.io/nuget/v/Cerulean.Components?label=Cerulean.Components) ![Nuget](https://img.shields.io/nuget/v/Cerulean.CLI?label=Cerulean.CLI)

Basic Information


Write cross-platform GUI apps using simple XML and C#.

Mainly testing on Windows and Ubuntu. Feel free to test on other platforms.



Check out this sample calculator app on CeruleanUI.



Should also work on OSX, but you need to install SDL2 and the other libraries to your frameworks folder.

Bundle your needed fonts in a folder called "Fonts" in the build directory as the font loader is jank with OSX.

Getting Started

> **Warning**
> This section is heavily under-construction. Use a release build instead if available.

1. Download a release build [here](https://github.com/Xapier14/Cerulean/releases) and extract the archive.
2. Add the `crn` executable to your binaries folder or add the containing folder to the `%PATH%` environment variable.
3. Create your new app via:
```bash
crn new
```
4. Build the project.
```bash
crn build
```
This should automatically build the XMLs, the dotnet project, and bundle the needed dependencies.

Currently, the bundler only works on a Windows build target for now. Support for other operating systems will come in a later update.

See "Important Notes" below on how to bundle and install dependencies for other OSs.
5. Run the app via:
```bash
crn run
```
If you run into DllNotFound errors, try running `crn bundle`.

Important Notes

- .NET 6 is **required** for the CLI tool.
- .NET 6 or newer projects are compatible with CeruleanUI.
- By default, the CLI should use the latest .NET SDK and creates a project with the same version.
- Use the appropriate SDL2 binaries for your app/system.
- On Any CPU, use the binaries appropriate for your system's architecture.
- On x86, use x86.
- On x64, use x64.
- On Windows, use the runtime binaries available at libsdl.org.
- On Ubuntu, simply do:
```bash
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-ttf-dev
sudo apt-get install libsdl2-image-dev
```
- **NOTE:** the snap version of `dotnet` will NOT find the SDL2 library. Please install dotnet with APT.
- See installing dotnet on MSDN.
- Relevant issue: exelix11/SysDVR (#118).
- Fonts will be searched first in a folder called `Fonts` in the environment's current directory, and then the system's font directory.
- The default font for the Label component is `Arial` (*Subject to change*).
- The library will find the first font with a filename of `Arial.ttf` or `Arial.otf`, this is case-insensitive.
- If not found, it will simply throw a `GeneralAPIException: "Font not found."`.

Features

### Cerulean API
- [x] Window Events
- [x] Styler Element
### Cerulean Components
- [x] Functional Components
- [x] Timer
- [x] Pointer
- [ ] Dialog Components
- [ ] Message Box
- [ ] Open File Dialog
- [ ] Save File Dialog
- [ ] Folder Select Dialog
- [x] Graphical Components
- [x] Rectangle
- [x] Image
- [x] Progress Bar
- [x] Label
- [ ] Input Components
- [x] TextBox
- [ ] MultiTextBox
- [x] Button
- [x] Check Box
- [x] Radio Button
- [ ] Drop Down List
- [ ] Container Components
- [x] Grid
- [x] Panel
- [ ] Stack Panel
- [ ] Group Tab
### Cerulean CLI
- [x] Style Builder
- [ ] C# Snippet Element
- [x] Project Builder/Scaffolder


## Warning
This is a WIP project, please do not use in commercial projects.

## License

This project uses the MIT License.
SDL2 and SDL2-CS, dependencies of this project, are released under the zlib license.