Crates.io | bevy_mod_billboard |
lib.rs | bevy_mod_billboard |
version | 0.7.0 |
source | src |
created_at | 2023-03-06 11:28:57.319068 |
updated_at | 2024-07-10 23:54:35.82977 |
description | Billboard text and texture support for bevy |
homepage | https://github.com/kulkalkul/bevy_mod_billboard.git |
repository | https://github.com/kulkalkul/bevy_mod_billboard.git |
max_upload_size | |
id | 802578 |
size | 220,699 |
Billboard text and texture support for bevy
Bevy Version | Crate Version |
---|---|
0.14 |
0.7.0 |
0.13 |
0.6.0 |
0.12 |
0.5.1 |
0.11 |
0.4.1 |
0.10 |
0.3.0 |
0.10 |
0.2.1 |
0.9 |
0.1.1 |
Setup:
use bevy_mod_billboard::prelude::*;
App::new()
.add_plugins((DefaultPlugins, BillboardPlugin));
Text:
commands.spawn(BillboardTextBundle {
transform: Transform::from_translation(Vec3::new(0., 2., 0.))
.with_scale(Vec3::splat(0.0085)),
text: Text::from_sections([
TextSection {
value: "IMPORTANT".to_string(),
style: TextStyle {
font_size: 60.0,
font: fira_sans_regular_handle.clone(),
color: Color::ORANGE,
}
},
TextSection {
value: " text".to_string(),
style: TextStyle {
font_size: 60.0,
font: fira_sans_regular_handle.clone(),
color: Color::WHITE,
}
}
]).with_alignment(TextAlignment::CENTER),
..default()
});
Texture:
commands.spawn(BillboardTextureBundle {
transform: Transform::from_translation(Vec3::new(0., 5., 0.)),
texture: BillboardTextureHandle(handle.clone()),
mesh: BillboardMeshHandle(meshes.add(Quad::new(Vec2::new(4.0, 4.0)).into()).into()),
..default()
});
Full examples at examples.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.