Asset examples
The engine's asset examples: what each one shows, whether it runs in a browser and the command that runs it.
Loading assets, asset events, custom assets and loaders, asset sources, saving and processing. There are 18 examples on this page. For the concepts behind them, see Assets.
Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.
Examples#
| Example | What it shows | Web | Run |
|---|---|---|---|
| Alter Mesh | Shows how to modify the underlying asset of a Mesh after spawning. | No | cargo run --example alter_mesh |
| Alter Sprite | Shows how to modify texture assets after spawning. | No | cargo run --example alter_sprite |
| Asset Decompression | Demonstrates loading a compressed asset | No | cargo run --example asset_decompression |
| Asset Loading | Demonstrates various methods to load assets | No | cargo run --example asset_loading |
| Asset Processing | Demonstrates how to process and load custom assets | No | cargo run --example asset_processing --features file_watcher,asset_processor |
| Asset Saving | Demonstrates how to save an asset | Yes | cargo run --example asset_saving --features ui_picking,sprite_picking,png |
| Asset Saving with Subassets | Demonstrates how to save an asset with subassets | Yes | cargo run --example asset_saving_with_subassets --features ui_picking,sprite_picking |
| Asset Settings | Demonstrates various methods of applying settings when loading an asset | No | cargo run --example asset_settings |
| Compressed Image Saver | Demonstrates compressing textures and generating mipmaps using CompressedImageSaver | No | cargo run --example compressed_image_saver --features compressed_image_saver,asset_processor,jpeg |
| Custom Asset | Implements a custom asset, with a default loader | Yes | cargo run --example custom_asset |
| Custom Asset IO | Implements a custom AssetReader | No | cargo run --example custom_asset_reader |
| Custom Asset Loader | Implements a custom asset loader | Yes | cargo run --example custom_asset_loader |
| Embedded Asset | Embed an asset in the application binary and load it | Yes | cargo run --example embedded_asset |
| Extra Asset Source | Load an asset from a non-standard asset source | No | cargo run --example extra_asset_source |
| Generated Assets | Shows how to generate and store assets at runtime | Yes | cargo run --example generated_assets |
| Hot Reloading of Assets | Demonstrates automatic reloading of assets when modified on disk | No | cargo run --example hot_asset_reloading --features file_watcher |
| Multi-asset synchronization | Demonstrates how to wait for multiple assets to be loaded. | Yes | cargo run --example multi_asset_sync |
| Repeated texture configuration | How to configure the texture to repeat instead of the default clamp to edges | Yes | cargo run --example repeated_texture |