#bevy #graphics #gamedev #billboard #3dtext

bevy_mod_billboard

Billboard text and texture support for bevy

11 releases (6 breaking)

0.7.0 Jul 10, 2024
0.6.0 Jun 9, 2024
0.5.1 Dec 5, 2023
0.4.1 Aug 31, 2023
0.1.1 Mar 8, 2023

#94 in Game dev

Download history 68/week @ 2024-07-21 79/week @ 2024-07-28 33/week @ 2024-08-04 37/week @ 2024-08-11 35/week @ 2024-08-18 121/week @ 2024-08-25 74/week @ 2024-09-01 57/week @ 2024-09-08 134/week @ 2024-09-15 154/week @ 2024-09-22 73/week @ 2024-09-29 74/week @ 2024-10-06 206/week @ 2024-10-13 85/week @ 2024-10-20 151/week @ 2024-10-27 129/week @ 2024-11-03

583 downloads per month

MIT/Apache

50KB
994 lines

bevy_mod_billboard

Billboard text and texture support for bevy

showcase

Todo

Features

  • Styled text with multiple fonts.
  • Textures.
  • Depth culling enabling/disabling (enabled by default).
  • Y-axis locking (disabled by default).
  • Full rotation lock for stuff like 3D world-space text (@robftm)
  • HDR support (@robtfm)

Bevy Compatibility

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

Example

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.

Changelog

[0.7.0] - 2024-07-11

  • Upgrade to Bevy 0.14 (@interwhy).
  • Add Billboard marker component.

[0.6.0] - 2024-06-09

  • Upgrade to Bevy 0.13 (@RobWalt).
  • Enable bevy's wayland & X11 features.

[0.5.1] - 2023-12-05

  • Fix billboard propagation not working.

[0.5.0] - 2023-12-04

  • Upgrade to Bevy 0.12 (@robftm).
  • Remove texture array implementation.
  • Use 1:N game world -> render world mapping.
  • Remove asset type BillboardTexture.
  • Add BillboardTextureHandle wrapper.
  • Reduce memory usage.
  • Increase performance for most used text case.
  • Add stress_test example (@alice-i-cecile).
  • Add rotating camera to most of the examples to showcase better.

License

Licensed under either of

at your option.

Contribution

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.

Dependencies

~44–82MB
~1.5M SLoC