Setting Up

First we're going to get a window setup so RAUI can render to it.

Creating the Project

Let's create a new Rust project and add our dependencies.

Create a new cargo project:

cargo new --bin my_project

Then add the following dependencies to the Cargo.toml:

[dependencies]
# The RAUI mother-crate
raui = { version = "*", features = ["app"] }

Initializing The Window

Next we need to setup our UI window. Using the raui-app crate this is super easy!

In most cases you will probably want to integrate RAUI with a game engine or other renderer, and in that case you would not use raui-app, you would use an integration crate like raui-tesselation-renderer. For now, though, we want to get right into RAUI without having to worry about integrations.

Go ahead and add the following to your main.rs file:

use raui::prelude::*;

fn main() {
    DeclarativeApp::simple("RAUI Guide", WidgetNode::default());
}

We don't add any widgets yet, we'll get to that in the next step. At this point you should be able to cargo run and have a blank window pop up!

OK, not that cool. We're not here for a blank window, so let's go put some GUI on the screen!

Note: You can find the full code for this chapter here

Edit this page on GitHub