[][src]Macro amethyst_assets::register_format

macro_rules! register_format {
    ($name:literal, $format:ty as $data:ty) => { ... };
    ($name:literal, $format:ty as $data:ty) => { ... };
    ($krate:ident; $name:literal, $format:ty as $data:ty) => { ... };
}

Register a dynamically deserializable format for given asset data type. Note that provided asset data type must also be registered using register_format_type macro.

This example is not tested
amethyst_assets::register_format!("WAV", WavFormat as AudioData);

The provided name literal ("WAV" in example) must be identical to the one returned from fn name implementation. This is required for right deserialization to be determined correctly. This parameter might be removed in the future when some macro limitations will be worked around.

The amethyst_assets crate must be in scope in order to use that macro. You can also specify name for the crate as additional first parameter.

This example is not tested
amethyst_assets::register_format!(renamed_assets_crate; "WAV", WavFormat as AudioData);