Enum SpriteSourceOutput
pub enum SpriteSourceOutput {
Texture {
sprite: Identifier,
texture: Identifier,
},
Pixels {
sprite: Identifier,
width: u32,
height: u32,
rgba: Vec<u8>,
},
Remove {
sprite: Identifier,
},
}Expand description
One step a mod’s sprite source takes on the atlas it is listed in, as vanilla’s
SpriteSource.Output takes them. Hooks::sprite_source pushes them in order, and they apply
under the built-in sources’ rule: a sprite of an id listed already replaces the earlier one.
Variants§
Texture
add(Identifier, Resource): sprite sprite is the texture texture
(assets/<namespace>/textures/<path>.png), with its .mcmeta. A texture the resources
lack is logged and skipped.
Fields
sprite: IdentifierThe sprite’s id in the atlas (mymod:gem).
texture: IdentifierThe texture it is (mymod:item/gem).
Pixels
add(Identifier, DiscardableLoader): sprite sprite is these pixels, width by height,
rows top first, four bytes (red, green, blue, alpha) a pixel. Pixels whose length isn’t
width * height * 4, or a side over the largest a sprite can have, are logged and skipped.
Fields
sprite: IdentifierThe sprite’s id in the atlas.
Remove
removeAll: drops sprite sprite from what the sources before listed, read in the event’s
listed. An id not listed changes nothing.
Fields
sprite: IdentifierThe sprite to drop.
Trait Implementations§
§impl Clone for SpriteSourceOutput
impl Clone for SpriteSourceOutput
§fn clone(&self) -> SpriteSourceOutput
fn clone(&self) -> SpriteSourceOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more