Expand description
Provides 2D sprite rendering functionality.
Modules§
- prelude
- The sprite prelude.
Structs§
- Border
Rect - Defines the extents of the border of a rectangle.
- 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 - Entities
Needing Specialization - Entity
Specialization Ticks - Extracted
Slice - Extracted
Slices - Extracted
Sprite - Extracted
Sprites - Extracted
Wireframe Color - 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. - Mesh2d
Bind Group - Mesh2d
Marker - Mesh2d
Pipeline - Mesh2d
Pipeline Key - Mesh2d
Render Plugin - Mesh2d
Transforms - Mesh2d
Uniform - Mesh2d
View Bind Group - Mesh2d
Wireframe - 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 - Render
Wireframe Instances - Render
Wireframe Material - SetMaterial2d
Bind Group - SetMesh2d
Bind Group - SetMesh2d
View Bind Group - SetSprite
Texture Bind Group - SetSprite
View Bind Group - SetWireframe2d
Push Constants - Specialized
Material2d Pipeline Cache - Stores the
SpecializedMaterial2dViewPipelineCache
for each view. - Specialized
Material2d View Pipeline Cache - Stores the cached render pipeline ID for each entity in a single view, as well as the last time it was changed.
- Specialized
Wireframe Pipeline Cache - Stores the
SpecializedWireframeViewPipelineCache
for each view. - Specialized
Wireframe View Pipeline Cache - Stores the cached render pipeline ID for each entity in a single view, as well as the last time it was changed.
- Sprite
- Describes a sprite to be rendered to a 2D camera
- Sprite
Asset Events - Sprite
Batch - Sprite
Batches - Sprite
Meta - Sprite
Picking Camera - An optional component that marks cameras that should be used in the
SpritePickingPlugin
. - Sprite
Picking Plugin - Enables the sprite picking backend, allowing you to click on, hover over and drag sprites.
- Sprite
Picking Settings - Runtime settings for the
SpritePickingPlugin
. - Sprite
Pipeline - Sprite
Pipeline Key - Sprite
Plugin - Adds support for 2D sprite rendering.
- Sprite
View Bind Group - 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.
- View
KeyCache - View
Specialization Ticks - Wireframe2d
- Enables wireframe rendering for any entity it is attached to.
It will ignore the
Wireframe2dConfig
global setting. - Wireframe2d
Batch SetKey - Wireframe2d
BinKey - Data that must be identical in order to batch phase items together.
- Wireframe2d
Color - Sets the color of the
Wireframe2d
of the entity it is attached to. - Wireframe2d
Config - Wireframe2d
Material - Wireframe2d
Phase Item - Wireframe2d
Pipeline - Wireframe2d
Plugin - A
Plugin
that draws wireframes for 2D meshes. - Wireframe
Entities Needing Specialization - Wireframe
Entity Specialization Ticks
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
. - Extracted
Sprite Kind - Scaling
Mode - Represents various modes for proportional scaling of a texture.
- Slice
Scale Mode - Defines how a texture slice scales when resized
- Sprite
Image Mode - Controls how the image is altered when scaled.
- Sprite
Picking Mode - How should the
SpritePickingPlugin
handle picking and how should it handle transparent pixels - Sprite
System - System set for sprite rendering.
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: - check_
entities_ needing_ specialization - check_
views_ need_ specialization - check_
wireframe_ entities_ needing_ specialization - extract_
entities_ needs_ specialization - extract_
mesh2d - extract_
mesh_ materials_ 2d - extract_
sprite_ events - extract_
sprites - extract_
wireframe_ entities_ needing_ specialization - extract_
wireframe_ materials - prepare_
mesh2d_ bind_ group - prepare_
mesh2d_ view_ bind_ groups - prepare_
sprite_ image_ bind_ groups - prepare_
sprite_ view_ bind_ groups - queue_
material2d_ meshes - queue_
sprites - specialize_
material2d_ meshes - specialize_
wireframes - tonemapping_
pipeline_ key
Type Aliases§
- Draw
Sprite RenderCommand
for sprite rendering.- Draw
Wireframe2d