Skip to content

Commit fa85a14

Browse files
Adding More Comments to the Embedded Assets Example (bevyengine#17865)
# Objective I noticed when I was looking at the embedded assets example that there wasn't any comments on it to indicate what an embedded asset is and why anyone would want to make one. ## Solution I added some more comments to the example that gives more detail about embedded assets and how they work. Feel free to be aggressive with rewriting these comments however, I just think the example could use something haha. --------- Co-authored-by: Alice Cecile <[email protected]>
1 parent f7b2a02 commit fa85a14

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/asset/embedded_asset.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
//! Example of loading an embedded asset.
22
3+
//! An embedded asset is an asset included in the program's memory, in contrast to other assets that are normally loaded from disk to memory when needed.
4+
//! The below example embeds the asset at program startup, unlike the common use case of embedding an asset at build time. Embedded an asset at program startup can be useful
5+
//! for things like loading screens, since it might be nice to display some art while other, non-embedded, assets are loading.
6+
7+
//! One common use case for embedded assets is including them directly within the executable during its creation. By embedding an asset at build time rather than runtime
8+
//! the program never needs to go to disk for the asset at all, since it is already located in the program's binary executable.
39
use bevy::{
410
asset::{embedded_asset, io::AssetSourceId, AssetPath},
511
prelude::*,

0 commit comments

Comments
 (0)