Expand description
Provides 2D sprite rendering functionality.
Modules§
- prelude
- The sprite prelude.
Structs§
- Border
Rect - Struct defining a
Sprite
border with padding values - Color
Material - A 2d material that renders 2d meshes with a texture tinted by a uniform color
- Color
Material Flags - Color
Material Plugin - Color
Material Uniform - The GPU representation of the uniform data of a
ColorMaterial
. - Draw
Mesh2d - Draw
Sprite Batch - Dynamic
Texture Atlas Builder - Helper utility to update
TextureAtlasLayout
on the fly. - Extracted
Sprite - Extracted
Sprites - Image
Bind Groups - Material2d
Bind Group Id - Material2d
Key - Material2d
Pipeline - Render pipeline data for a given
Material2d
- Material2d
Plugin - Adds the necessary ECS resources and render logic to enable rendering entities using the given
Material2d
asset type (which includesMaterial2d
types). - Material2d
Properties - Common
Material2d
properties, calculated for a specific material instance. - Material
Mesh2d Bundle Deprecated - A component bundle for entities with a
Mesh2d
and aMeshMaterial2d
. - Mesh2d
Bind Group - Mesh2d
Marker - Mesh2d
Pipeline - Mesh2d
Pipeline Key - Mesh2d
Render Plugin - Mesh2d
Transforms - Mesh2d
Uniform - Mesh2d
View Bind Group - Mesh
Flags - Mesh
Material2d - 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. - Prepared
Material2d - Data prepared for a
Material2d
instance. - Render
Material2d Instances - Render
Mesh2d Instance - Render
Mesh2d Instances - SetMaterial2d
Bind Group - SetMesh2d
Bind Group - SetMesh2d
View Bind Group - SetSprite
Texture Bind Group - SetSprite
View Bind Group - Sprite
- Describes a sprite to be rendered to a 2D camera
- Sprite
Asset Events - Sprite
Batch - Sprite
Bundle Deprecated - A
Bundle
of components for drawing a single sprite from an image. - Sprite
Meta - Sprite
Pipeline - Sprite
Pipeline Key - Sprite
Plugin - Adds support for 2D sprite rendering.
- Sprite
Source - A component that marks entities that aren’t themselves sprites but become sprites during rendering.
- Sprite
View Bind Group - Texture
Atlas - An index into a
TextureAtlasLayout
, which corresponds to a specific section of a texture. - Texture
Atlas Builder - A builder which is used to create a texture atlas from many individual sprites.
- Texture
Atlas Layout - 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. - Texture
Atlas Sources - Stores a mapping from sub texture handles to the related area index.
- Texture
Slice - Single texture slice, representing a texture rect to draw in a given area
- Texture
Slicer - 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. - Wireframe2d
Color - Sets the color of the
Wireframe2d
of the entity it is attached to. - Wireframe2d
Config - Wireframe2d
Material - Wireframe2d
Plugin - A
Plugin
that draws wireframes for 2D meshes.
Enums§
- Alpha
Mode2d - 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 toAnchor::Center
. - Slice
Scale Mode - Defines how a texture slice scales when resized
- Sprite
Image Mode - Controls how the image is altered when scaled.
- Sprite
System - System set for sprite rendering.
- Texture
Atlas Builder Error
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
, andMeshMaterial2d
to spawn entities that are rendered with a specificMaterial2d
type. They serve as an easy to use high level way to renderMesh2d
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§
- Color
Mesh2d Bundle Deprecated - A component bundle for entities with a
Mesh2d
and aColorMaterial
. - Draw
Sprite RenderCommand
for sprite rendering.- Texture
Atlas Builder Result - With
Sprite - A convenient alias for
Or<With<Sprite>, With<SpriteSource>>
, for use withbevy_render::view::VisibleEntities
.