Crate bevy_sprite
source ·Expand description
Provides 2D sprite rendering functionality.
Modules§
Structs§
- Struct defining a
Sprite
border 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
TextureAtlasLayout
on the fly. - Render pipeline data for a given
Material2d
- Adds the necessary ECS resources and render logic to enable rendering entities using the given
Material2d
asset type (which includesMaterial2d
types). - A component bundle for entities with a
Mesh2dHandle
and 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
Wireframe2dConfig
global setting. - Data prepared for a
Material2d
instance. - Specifies the rendering properties of a sprite.
- A
Bundle
of components for drawing a single sprite from an image. - Adds support for 2D sprite rendering.
- Sprite
Sheet Bundle Deprecated ABundle
of 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
Wireframe2dConfig
global setting. - Sets the color of the
Wireframe2d
of the entity it is attached to. If this component is present but there’s noWireframe2d
component, it will still affect the color of the wireframe whenWireframe2dConfig::global
is set to true. - A
Plugin
that 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
Material2dPlugin
andMaterialMesh2dBundle
to spawn entities that are rendered with a specificMaterial2d
type. They serve as an easy to use high level way to renderMesh2dHandle
entities with custom shader logic.
Functions§
- System calculating and inserting an
Aabb
component to entities with either:
Type Aliases§
- A component bundle for entities with a
Mesh2dHandle
and aColorMaterial
. RenderCommand
for 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
.