Crate bevy_sprite

Source
Expand description

Provides 2D sprite rendering functionality.

Modules§

prelude
The sprite prelude.

Structs§

BorderRect
Struct defining a Sprite border with padding values
ColorMaterial
A 2d material that renders 2d meshes with a texture tinted by a uniform color
ColorMaterialFlags
ColorMaterialPlugin
ColorMaterialUniform
The GPU representation of the uniform data of a ColorMaterial.
DrawMesh2d
DrawSpriteBatch
DynamicTextureAtlasBuilder
Helper utility to update TextureAtlasLayout on the fly.
ExtractedSprite
ExtractedSprites
ImageBindGroups
Material2dBindGroupId
Material2dKey
Material2dPipeline
Render pipeline data for a given Material2d
Material2dPlugin
Adds the necessary ECS resources and render logic to enable rendering entities using the given Material2d asset type (which includes Material2d types).
Material2dProperties
Common Material2d properties, calculated for a specific material instance.
MaterialMesh2dBundleDeprecated
A component bundle for entities with a Mesh2d and a MeshMaterial2d.
Mesh2dBindGroup
Mesh2dMarker
Mesh2dPipeline
Mesh2dPipelineKey
Mesh2dRenderPlugin
Mesh2dTransforms
Mesh2dUniform
Mesh2dViewBindGroup
MeshFlags
MeshMaterial2d
A material used for rendering a Mesh2d.
NoWireframe2d
Disables wireframe rendering for any entity it is attached to. It will ignore the Wireframe2dConfig global setting.
PreparedMaterial2d
Data prepared for a Material2d instance.
RenderMaterial2dInstances
RenderMesh2dInstance
RenderMesh2dInstances
SetMaterial2dBindGroup
SetMesh2dBindGroup
SetMesh2dViewBindGroup
SetSpriteTextureBindGroup
SetSpriteViewBindGroup
Sprite
Describes a sprite to be rendered to a 2D camera
SpriteAssetEvents
SpriteBatch
SpriteBundleDeprecated
A Bundle of components for drawing a single sprite from an image.
SpriteMeta
SpritePipeline
SpritePipelineKey
SpritePlugin
Adds support for 2D sprite rendering.
SpriteSource
A component that marks entities that aren’t themselves sprites but become sprites during rendering.
SpriteViewBindGroup
TextureAtlas
An index into a TextureAtlasLayout, which corresponds to a specific section of a texture.
TextureAtlasBuilder
A builder which is used to create a texture atlas from many individual sprites.
TextureAtlasLayout
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.
TextureAtlasSources
Stores a mapping from sub texture handles to the related area index.
TextureSlice
Single texture slice, representing a texture rect to draw in a given area
TextureSlicer
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.
Wireframe2d
Enables wireframe rendering for any entity it is attached to. It will ignore the Wireframe2dConfig global setting.
Wireframe2dColor
Sets the color of the Wireframe2d of the entity it is attached to.
Wireframe2dConfig
Wireframe2dMaterial
Wireframe2dPlugin
A Plugin that draws wireframes for 2D meshes.

Enums§

AlphaMode2d
Sets how a 2d material’s base color alpha channel is used for transparency. Currently, this only works with Mesh2d. Sprites are always transparent.
Anchor
How a sprite is positioned relative to its Transform. It defaults to Anchor::Center.
SliceScaleMode
Defines how a texture slice scales when resized
SpriteImageMode
Controls how the image is altered when scaled.
SpriteSystem
System set for sprite rendering.
TextureAtlasBuilderError

Constants§

COLOR_MATERIAL_SHADER_HANDLE
MESH2D_BINDINGS_HANDLE
MESH2D_FUNCTIONS_HANDLE
MESH2D_SHADER_HANDLE
MESH2D_TYPES_HANDLE
MESH2D_VERTEX_OUTPUT
MESH2D_VIEW_BINDINGS_HANDLE
MESH2D_VIEW_TYPES_HANDLE
SPRITE_SHADER_HANDLE
SPRITE_VIEW_BINDINGS_SHADER_HANDLE
WIREFRAME_2D_SHADER_HANDLE

Traits§

Material2d
Materials are used alongside Material2dPlugin, Mesh2d, and MeshMaterial2d to spawn entities that are rendered with a specific Material2d type. They serve as an easy to use high level way to render Mesh2d entities with custom shader logic.

Functions§

alpha_mode_pipeline_key
calculate_bounds_2d
System calculating and inserting an Aabb component to entities with either:
extract_mesh2d
extract_mesh_materials_2d
extract_sprite_events
extract_sprites
prepare_mesh2d_bind_group
prepare_mesh2d_view_bind_groups
prepare_sprite_image_bind_groups
prepare_sprite_view_bind_groups
queue_material2d_meshes
queue_sprites
tonemapping_pipeline_key

Type Aliases§

ColorMesh2dBundleDeprecated
A component bundle for entities with a Mesh2d and a ColorMaterial.
DrawSprite
RenderCommand for sprite rendering.
TextureAtlasBuilderResult
WithSprite
A convenient alias for Or<With<Sprite>, With<SpriteSource>>, for use with bevy_render::view::VisibleEntities.