Expand description
Provides 2D sprite rendering functionality.
Modules§
- The sprite prelude.
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). - Common
Material2dproperties, calculated for a specific material instance. - Material
Mesh2d Bundle Deprecated A component bundle for entities with aMesh2dand aMeshMaterial2d. - Disables wireframe rendering for any entity it is attached to. It will ignore the
Wireframe2dConfigglobal setting. - Data prepared for a
Material2dinstance. - Describes a sprite to be rendered to a 2D camera
- Sprite
Bundle Deprecated ABundleof components for drawing a single sprite from an image. - Adds support for 2D sprite rendering.
- A component that marks entities that aren’t themselves sprites but become sprites during rendering.
- An index into a
TextureAtlasLayout, which corresponds to 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. - Stores a mapping from sub texture handles to the related area index.
- 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. - A
Pluginthat draws wireframes for 2D meshes.
Enums§
- Sets how a 2d material’s base color alpha channel is used for transparency. Currently, this only works with
Mesh2d. Sprites are always transparent. - How a sprite is positioned relative to its
Transform. It defaults toAnchor::Center. - Defines how a texture slice scales when resized
- Controls how the image is altered when scaled.
- System set for sprite rendering.
Constants§
Traits§
- Materials are used alongside
Material2dPlugin,Mesh2d, andMeshMaterial2dto spawn entities that are rendered with a specificMaterial2dtype. They serve as an easy to use high level way to renderMesh2dentities with custom shader logic.
Functions§
- System calculating and inserting an
Aabbcomponent to entities with either:
Type Aliases§
- Color
Mesh2d Bundle Deprecated A component bundle for entities with aMesh2dand aColorMaterial. RenderCommandfor sprite rendering.- A convenient alias for
Or<With<Sprite>, With<SpriteSource>>, for use withbevy_render::view::VisibleEntities.