Crates.io | bevy_raylib |
lib.rs | bevy_raylib |
version | 0.0.1 |
source | src |
created_at | 2023-10-15 00:56:45.916508 |
updated_at | 2023-10-15 01:14:26.022552 |
description | A very simple Raylib plugin for Bevy |
homepage | |
repository | https://github.com/ickk/bevy_raylib |
max_upload_size | |
id | 1003364 |
size | 38,492 |
This is a very simple raylib plugin for bevy.
use bevy_app::prelude::*;
use bevy_ecs::prelude::*;
use bevy_raylib::prelude::*;
use bevy_utils::prelude::*;
fn main() {
App::new()
.add_plugins(RaylibPlugin)
.insert_resource(WindowConfig {
title: "Bevy + Raylib".to_owned(),
..default()
})
.add_systems(PostUpdate, render)
.run();
}
fn render(mut raylib: NonSendMut<RaylibContext>, cursor: Res<Cursor>) {
let mut d = raylib.begin_drawing();
d.clear_background(Color::WHITE);
d.draw_text(
&format!("{}, {}", cursor.x, cursor.y),
12,
12,
20,
Color::BLACK,
);
}