blaind / bevy_text_mesh

A bevy 3D text mesh generator for displaying text
MIT License
65 stars 16 forks source link

Updated to Bevy 0.13.0 #36

Open nilsegger opened 7 months ago

nilsegger commented 7 months ago

Hey, using this guide from bevy I updated this library to use bevy 0.13.0.

I ran the examples and they all seem to work.

Some observations that may hint to my changes being faulty:

When running I get the following message: Duplicate AssetLoader registered for Asset typebevy_text::font::Fontwith extensions["ttf"]. Loader must be specified in a .meta file in order to load assets of this type with these extensions.

For some reason now, even if mesh is Some, meshes.get_mut may return None, maybe this is connected to the above message.

if let Some(mesh) = mesh {
    if let Some(asset_mesh) = meshes.get_mut(mesh) {
        new_mesh = false;
        let ttf2_mesh =
            generate_text_mesh(&text_mesh, &mut font.ttf_font, Some(&mut cache));
        apply_mesh(ttf2_mesh, asset_mesh);
    }
}

I hope my changes are of some use. As said, the examples work at least, so for developing and testing it should be usable.