Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

15.1 Hello World

Live Demo

Open the demo in a separate tab.

This is the smallest useful Beverly app: a root Ui composition with a centered, themed text node.

use bevy::prelude::*;
use beverly::prelude::*;

fn main() {
	App::new().ui(my_ui()).run();
}

fn my_ui() -> Ui {
	ui()
		.width(percent(100))
		.height(percent(100))
		.center()
		.theme(light_theme())
		.children([text("Hello, World!")])
}

This same example is available in the repository at examples/hello_world.rs.