Crate bevy_sprite
source ·Expand description
Provides 2D sprite rendering functionality.
Modules§
Structs§
- Struct defining a
Spriteborder with padding values - A 2d material that renders 2d meshes with a texture tinted by a uniform color
- The GPU representation of the uniform data of a
ColorMaterial. - Helper utility to update
TextureAtlasLayouton the fly. - Render pipeline data for a given
Material2d - Adds the necessary ECS resources and render logic to enable rendering entities using the given
Material2dasset type (which includesMaterial2dtypes). - A component bundle for entities with a
Mesh2dHandleand aMaterial2d. - Component for rendering with meshes in the 2d pipeline, usually with a 2d material such as
ColorMaterial. - Disables wireframe rendering for any entity it is attached to. It will ignore the
Wireframe2dConfigglobal setting. - Data prepared for a
Material2dinstance. - Specifies the rendering properties of a sprite.
- A
Bundleof components for drawing a single sprite from an image. - Adds support for 2D sprite rendering.
- SpriteSheetBundleDeprecatedA
Bundleof components for drawing a single sprite from a sprite sheet (also referred to as aTextureAtlas) or for animated sprites. - A component that marks entities that aren’t themselves sprites but become sprites during rendering.
- Component used to draw a specific section of a texture.
- A builder which is used to create a texture atlas from many individual sprites.
- Stores a map used to lookup the position of a texture in a
TextureAtlas. This can be used to either use and look up a specific section of a texture, or animate frame-by-frame as a sprite sheet. - Single texture slice, representing a texture rect to draw in a given area
- Slices a texture using the 9-slicing technique. This allows to reuse an image at various sizes without needing to prepare multiple assets. The associated texture will be split into nine portions, so that on resize the different portions scale or tile in different ways to keep the texture in proportion.
- Enables wireframe rendering for any entity it is attached to. It will ignore the
Wireframe2dConfigglobal setting. - Sets the color of the
Wireframe2dof the entity it is attached to. If this component is present but there’s noWireframe2dcomponent, it will still affect the color of the wireframe whenWireframe2dConfig::globalis set to true. - A
Pluginthat draws wireframes for 2D meshes.
Enums§
- How a sprite is positioned relative to its
Transform. It defaults toAnchor::Center. - Controls how the image is altered when scaled.
- Defines how a texture slice scales when resized
- System set for sprite rendering.
Constants§
Traits§
- Materials are used alongside
Material2dPluginandMaterialMesh2dBundleto spawn entities that are rendered with a specificMaterial2dtype. They serve as an easy to use high level way to renderMesh2dHandleentities with custom shader logic.
Functions§
- System calculating and inserting an
Aabbcomponent to entities with either:
Type Aliases§
- A component bundle for entities with a
Mesh2dHandleand aColorMaterial. RenderCommandfor sprite rendering.- A convenient alias for
With<Mesh2dHandle>>, for use withbevy_render::view::VisibleEntities. - A convenient alias for
Or<With<Sprite>, With<SpriteSource>>, for use withbevy_render::view::VisibleEntities.