Crate sprite

Source
Expand description

Provides 2D sprite rendering functionality.

Modules§

prelude
The sprite prelude.

Structs§

BorderRect
Defines the extents of the border of a rectangle.
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
EntitiesNeedingSpecialization
EntitySpecializationTicks
ExtractedSlice
ExtractedSlices
ExtractedSprite
ExtractedSprites
ExtractedWireframeColor
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.
Mesh2dBindGroup
Mesh2dMarker
Mesh2dPipeline
Mesh2dPipelineKey
Mesh2dRenderPlugin
Mesh2dTransforms
Mesh2dUniform
Mesh2dViewBindGroup
Mesh2dWireframe
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
RenderWireframeInstances
RenderWireframeMaterial
SetMaterial2dBindGroup
SetMesh2dBindGroup
SetMesh2dViewBindGroup
SetSpriteTextureBindGroup
SetSpriteViewBindGroup
SetWireframe2dPushConstants
SpecializedMaterial2dPipelineCache
Stores the SpecializedMaterial2dViewPipelineCache for each view.
SpecializedMaterial2dViewPipelineCache
Stores the cached render pipeline ID for each entity in a single view, as well as the last time it was changed.
SpecializedWireframePipelineCache
Stores the SpecializedWireframeViewPipelineCache for each view.
SpecializedWireframeViewPipelineCache
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
SpriteAssetEvents
SpriteBatch
SpriteBatches
SpriteMeta
SpritePickingCamera
An optional component that marks cameras that should be used in the SpritePickingPlugin.
SpritePickingPlugin
Enables the sprite picking backend, allowing you to click on, hover over and drag sprites.
SpritePickingSettings
Runtime settings for the SpritePickingPlugin.
SpritePipeline
SpritePipelineKey
SpritePlugin
Adds support for 2D sprite rendering.
SpriteViewBindGroup
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.
ViewKeyCache
ViewSpecializationTicks
Wireframe2d
Enables wireframe rendering for any entity it is attached to. It will ignore the Wireframe2dConfig global setting.
Wireframe2dBatchSetKey
Wireframe2dBinKey
Data that must be identical in order to batch phase items together.
Wireframe2dColor
Sets the color of the Wireframe2d of the entity it is attached to.
Wireframe2dConfig
Wireframe2dMaterial
Wireframe2dPhaseItem
Wireframe2dPipeline
Wireframe2dPlugin
A Plugin that draws wireframes for 2D meshes.
WireframeEntitiesNeedingSpecialization
WireframeEntitySpecializationTicks

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.
ExtractedSpriteKind
ScalingMode
Represents various modes for proportional scaling of a texture.
SliceScaleMode
Defines how a texture slice scales when resized
SpriteImageMode
Controls how the image is altered when scaled.
SpritePickingMode
How should the SpritePickingPlugin handle picking and how should it handle transparent pixels
SpriteSystem
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, 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:
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§

DrawSprite
RenderCommand for sprite rendering.
DrawWireframe2d