Crates.io | raylib-ext |
lib.rs | raylib-ext |
version | 0.1.0 |
source | src |
created_at | 2024-10-30 13:11:33.950108 |
updated_at | 2024-10-30 13:11:33.950108 |
description | Adds some small features to raylib-rs |
homepage | |
repository | |
max_upload_size | |
id | 1428495 |
size | 5,953 |
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.
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);
}
}