Struct amethyst_renderer::SpriteRenderData [−][src]
pub struct SpriteRenderData<'a> {
pub meshes: WriteStorage<'a, MeshHandle>,
pub materials: WriteStorage<'a, Material>,
pub material_defaults: ReadExpect<'a, MaterialDefaults>,
pub loader: ReadExpect<'a, Loader>,
pub asset_storage: Read<'a, AssetStorage<Mesh>>,
}SystemData containing the data necessary to handle new rendered sprites
Fields
meshes: WriteStorage<'a, MeshHandle>
Storage containing the meshes
materials: WriteStorage<'a, Material>
Storage containing the materials
material_defaults: ReadExpect<'a, MaterialDefaults>
Material defaults
loader: ReadExpect<'a, Loader>
Asset loader
asset_storage: Read<'a, AssetStorage<Mesh>>
Mesh asset storage
Methods
impl<'a> SpriteRenderData<'a>[src]
impl<'a> SpriteRenderData<'a>pub fn add(
&mut self,
entity: Entity,
sprite: &Sprite,
texture: TextureHandle,
texture_size: (f32, f32)
) -> Result<()>[src]
pub fn add(
&mut self,
entity: Entity,
sprite: &Sprite,
texture: TextureHandle,
texture_size: (f32, f32)
) -> Result<()>Adds a mesh and a material to an entity corresponding to the sprite and texture given.
Note that is you need to insert the same sprite and texture, using add_multiple allows for better performances.
pub fn add_multiple(
&mut self,
entities: Vec<Entity>,
sprite: &Sprite,
texture: TextureHandle,
texture_size: (f32, f32)
) -> Result<()>[src]
pub fn add_multiple(
&mut self,
entities: Vec<Entity>,
sprite: &Sprite,
texture: TextureHandle,
texture_size: (f32, f32)
) -> Result<()>Adds the same mesh and material to multiple entities corresponding to the sprite and texture given.
Trait Implementations
impl<'a> SystemData<'a> for SpriteRenderData<'a> where
WriteStorage<'a, MeshHandle>: SystemData<'a>,
WriteStorage<'a, Material>: SystemData<'a>,
ReadExpect<'a, MaterialDefaults>: SystemData<'a>,
ReadExpect<'a, Loader>: SystemData<'a>,
Read<'a, AssetStorage<Mesh>>: SystemData<'a>, [src]
impl<'a> SystemData<'a> for SpriteRenderData<'a> where
WriteStorage<'a, MeshHandle>: SystemData<'a>,
WriteStorage<'a, Material>: SystemData<'a>,
ReadExpect<'a, MaterialDefaults>: SystemData<'a>,
ReadExpect<'a, Loader>: SystemData<'a>,
Read<'a, AssetStorage<Mesh>>: SystemData<'a>, fn setup(res: &mut Resources)[src]
fn setup(res: &mut Resources)Sets up the system data for fetching it from the Resources.
fn fetch(res: &'a Resources) -> Self[src]
fn fetch(res: &'a Resources) -> SelfFetches the system data from Resources. Note that this is only specified for one concrete lifetime 'a, you need to implement the SystemData trait for every possible lifetime. Read more
fn reads() -> Vec<ResourceId>[src]
fn reads() -> Vec<ResourceId>Returns all read dependencies as fetched from Self::fetch. Read more
fn writes() -> Vec<ResourceId>[src]
fn writes() -> Vec<ResourceId>Returns all write dependencies as fetched from Self::fetch. Read more
Auto Trait Implementations
impl<'a> Send for SpriteRenderData<'a>
impl<'a> Send for SpriteRenderData<'a>impl<'a> Sync for SpriteRenderData<'a>
impl<'a> Sync for SpriteRenderData<'a>