raylib-ext

Crates.ioraylib-ext
lib.rsraylib-ext
version0.1.0
sourcesrc
created_at2024-10-30 13:11:33.950108
updated_at2024-10-30 13:11:33.950108
descriptionAdds some small features to raylib-rs
homepage
repository
max_upload_size
id1428495
size5,953
Sietse (Sietse2202)

documentation

README

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);
  }
}
Commit count: 0

cargo fmt