bevy_slugtext versions are tied to the supported Bevy release:
bevy_slugtext |
bevy |
|---|---|
0.1.1 |
0.19 |
0.1.0 |
0.18 |
Add to Cargo.toml:
[dependencies]
bevy_slugtext = "0.1.1"
Include the library:
use bevy_slugtext::prelude::*;Second, add a SlugTextPlugin to your app:
App::new()
...
.add_plugins(SlugTextPlugin)
...;Then, spawn a textmesh bundle:
commands.spawn((
TextMesh {
text: "hello world".to_string(),
font: asset_server.load("fonts/Inter.ttf"),
color: Color::Srgba(Srgba::WHITE),
size: 1.0,
..Default::default()
},
Transform::from_xyz(-2.5, 0.0, 0.0),
));