Crate bevy_doryen
source ·Expand description
bevy_doryen is a Bevy plugin that lets you use Bevy with the Doryen roguelike library.
Usage:
App::new()
// Insert a `DoryenPluginSettings` resource to configure the plugin.
.insert_resource(DoryenPluginSettings {
// `app_options` lets you configure Doryen just as if you were
// using Doryen without Bevy. The default is `AppOptions::default()`.
app_options: AppOptions {
show_cursor: true,
resizable: true,
..AppOptions::default()
},
// Lets you configure which mouse buttons to listen for. The default
// is left, middle and right click.
mouse_button_listeners: vec![
MouseButton::Left,
MouseButton::Middle,
MouseButton::Right,
],
// Lets you configure how the application should behave when resized.
// The default is `ResizeMode::Nothing`. See `ResizeMode`'s
// documentation for more information.
resize_mode: ResizeMode::Nothing
})
// Add the `DoryenPlugin` to Bevy.
.add_plugins(DoryenPlugin)
// Add your Bevy systems like usual. Excluding startup systems, which
// only run once, these systems are run during Doryen's update phase;
// i.e. 60 times per second.
.add_systems(Startup, init)
.add_systems(Update, input)
// The `Render` schedules lets you add systems that should
// be run during Doryen's render phase.
.add_systems(Render, render)
.run();
Modules§
- Re-export of the Doryen library types.
- Common imports
Structs§
- Emitting this event causes bevy_doryen to return
UpdateEvent::Capture
from its Doryenupdate
function, which saves a screenshot. See its documentation for more details. - The Bevy Doryen plugin.
- DoryenPlugin settings.
- Runs first in the schedule. This is run by the
MainRender
schedule. - This resource contains the values given by
fps
andaverage_fps
on the current update tick. - Provides access to the input events handled by the Doryen engine. See the documentation for the
InputApi
type for details on what values should be used with the variouskey
methods. - An iterator visiting all keys in arbitrary order.
- Runs last in the schedule. This is run by the
MainRender
schedule. - The schedule that contains the render logic that is evaluated each tick of
doryen_rs::Engine::render
. - Defines the schedules to be run for the
Render
schedule, including their order. - The schedule that contains logic that must run after
Render
. - The schedule that contains logic that must run before
Render
. - The schedule that contains render logic.
- Resized event object. Whenever Doryen’s
resize
method is called, an event of this type is emitted. - Provides access to the root console of the Doryen engine.
- When you want to change Doryen’s font path, emit an event of this type. bevy_doryen will call
set_font_path
with the provided value. See its documentation for more details.
Enums§
- Represents buttons on a mouse.
- How the
DoryenPlugin
reacts to the resize event from Doryen.