#raylib #ext #text #hello-world #prelude #size #raylib-rs

raylib-ext

Adds some small features to raylib-rs

1 unstable release

0.1.0 Oct 30, 2024

#6 in #ext

Download history 107/week @ 2024-10-27 5/week @ 2024-11-03

112 downloads per month

MIT license

5KB

Raylib-rs-ext

Please note that I'm not affiliated with raylib-rs, I thought it'd be a good idea to port some more stuff from the original raylib, now here we are.

Examples

use raylib::prelude::*;
use raylib_ext::*;

fn main() {
  let (mut rl, thread) = init()
    .size(640, 480)
    .title("Hello, World")
    .build();

  while !rl.window_should_close() {
    let mut d = rl.begin_drawing(&thread);
    d.clear_background(Color::WHITE);

    // Draws text where (x, y) is in the middle of the text instead of top-left
    d.draw_centered_text("Hello, world!", 12, 12, 20, Color::BLACK);
  }
}
use raylib::prelude::*;
use raylib_ext::*;

fn main() {
  let (mut rl, thread) = init()
    .size(640, 480)
    .title("Hello, World")
    .build();

  while !rl.window_should_close() {
    let mut d = rl.begin_drawing(&thread);

    d.clear_background(Color::WHITE);

    // Draws text where (x, y) is in the top-right corner instead of top-left
    d.draw_right_aligned_text("Hello, world!", 12, 12, 20, Color::BLACK);
  }
}

Dependencies

~6–14MB
~185K SLoC