bevy_raylib

Crates.iobevy_raylib
lib.rsbevy_raylib
version0.0.1
sourcesrc
created_at2023-10-15 00:56:45.916508
updated_at2023-10-15 01:14:26.022552
descriptionA very simple Raylib plugin for Bevy
homepage
repositoryhttps://github.com/ickk/bevy_raylib
max_upload_size
id1003364
size38,492
(ickk)

documentation

https://docs.rs/bevy_raylib

README

bevy_raylib

This is a very simple raylib plugin for bevy.

Usage

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

cargo fmt