bevy_text_mesh icon indicating copy to clipboard operation
bevy_text_mesh copied to clipboard

Warning or message when `#mesh` suffix is missing

Open stevenctl opened this issue 2 years ago • 2 comments

Not sure what type of asset ends up getting loaded in this case, but Res<Assets<TextMeshFont>>::get yields None without #mesh, so of course nothing would be displayed.

This is the result of me misreading the docs/examples but I feel like something should blow up or yell at me for this.

stevenctl avatar Dec 10 '22 07:12 stevenctl

Alternatively, dropping the requirement for #mesh could be nice. Is that there just to avoid conflicts with other plugins that might expose ttf loaders?

stevenctl avatar Dec 10 '22 07:12 stevenctl

The #mesh requirement is not ideal, but it was added as a fix for #9 and #3. The bevy asset loader does not retain original-file-bytes so multiple instances (bevy_text_mesh and other 2d instances) can not be used simultaneously.

I don't see easy solutions here. Probably hard to implement a warning for ::get as well (in this crate). Maybe having bevy asset loader to retain the bytes would be one option.

blaind avatar Jan 02 '23 17:01 blaind