在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:octotep/bevy_crossterm开源软件地址:https://github.com/octotep/bevy_crossterm开源编程语言:Rust 100.0%开源软件介绍:What is bevy_crossterm?
Table of ContentsFeatures
Demo GIFGetting StartedSee the examples for runnable code and detailed comments. [dependencies]
bevy = { version = "0.4", default-features = false }
bevy_crossterm = "0.4.0" use bevy::prelude::*;
use bevy_crossterm::prelude::*;
pub fn main() {
let mut settings = CrosstermWindowSettings::default();
settings.set_title("Hello, World!");
App::build()
// Add our window settings
.add_resource(settings)
// Add the DefaultPlugins before the CrosstermPlugin. The crossterm plugin needs bevy's asset server, and if it's
// not available you'll trigger an assert
.add_plugins(DefaultPlugins)
.add_plugin(CrosstermPlugin)
.add_startup_system(startup_system.system())
.run();
}
fn startup_system(
commands: &mut Commands,
mut sprites: ResMut<Assets<Sprite>>,
mut stylemaps: ResMut<Assets<StyleMap>>,
) {
commands
.spawn(SpriteBundle {
sprite: sprites.add(Sprite::new("Hello, world!")),
stylemap: stylemaps.add(StyleMap::default()),
..Default::default()
});
} Press Control-c to exit at any time. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论