11 releases

new 0.3.2 Jun 1, 2024
0.3.1 May 31, 2024
0.2.4 Nov 25, 2022
0.2.2 Sep 28, 2022
0.1.0 Feb 17, 2022

#296 in Rendering

Download history 50/week @ 2024-02-25 18/week @ 2024-03-03 5/week @ 2024-03-10 10/week @ 2024-03-31 1/week @ 2024-04-07 266/week @ 2024-05-26

266 downloads per month

MIT/Apache

625KB
14K SLoC

renderling-ui

renderling-ui specializes renderling to drawing two dimensional user interfaces.


lib.rs:

renderling-ui is a "GPU driven" 2d renderer with a focus on simplicity and ease of use.

This library is meant to be used with its parent renderling.

Getting Started

First we create a context, then we create a [Ui], which we can use to "stage" our paths, text, etc:

use renderling::{math::Vec2, Context};
use renderling_ui::Ui;

let ctx = Context::headless(100, 100);
let mut ui = Ui::new(&ctx);

let _path = ui
    .new_path()
    .with_stroke_color([1.0, 1.0, 0.0, 1.0])
    .with_rectangle(Vec2::splat(10.0), Vec2::splat(60.0))
    .stroke();

let frame = ctx.get_next_frame().unwrap();
ui.render(&frame.view());
frame.present();

Happy hacking!

Dependencies

~32–70MB
~1M SLoC