From fa85a14de13242fe10c8d07679576ebc43be22ea Mon Sep 17 00:00:00 2001 From: Carter Weinberg Date: Mon, 24 Feb 2025 16:13:24 -0500 Subject: [PATCH] Adding More Comments to the Embedded Assets Example (#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 --- examples/asset/embedded_asset.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/asset/embedded_asset.rs b/examples/asset/embedded_asset.rs index 66349cfc5a..df425b0790 100644 --- a/examples/asset/embedded_asset.rs +++ b/examples/asset/embedded_asset.rs @@ -1,5 +1,11 @@ //! Example of loading an embedded asset. +//! 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. +//! 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 +//! for things like loading screens, since it might be nice to display some art while other, non-embedded, assets are loading. + +//! 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 +//! the program never needs to go to disk for the asset at all, since it is already located in the program's binary executable. use bevy::{ asset::{embedded_asset, io::AssetSourceId, AssetPath}, prelude::*,