Expand description
use bevy::prelude::*;
to import common components, bundles, and plugins.
Modules
- Generation for some primitive shape meshes.
- A collection of common adapters for piping the result of a system.
Macros
- Constructs an event at the debug level.
- Constructs a span at the debug level.
- Constructs an event at the error level.
- Constructs a span at the error level.
- Constructs an event at the info level.
- Constructs a span at the info level.
- Constructs an event at the trace level.
- Constructs a span at the trace level.
- Constructs an event at the warn level.
- Constructs a span at the warn level.
Structs
- Command that adds a child to an entity
- A filter on a component that only retains results added after the system last ran.
- An ambient light, which lights the entire scene equally.
- A list of
VariableCurve
, and theEntityPath
to which they apply. - Animation controls
- Adds animation support to an app
- The
AnyOf
query parameter fetches entities with any of the component types included in T. - A container of app logic and data.
- Adds support for
Assets
to an App. - Loads assets from the filesystem in the background.
- Stores Assets of a given type and tracks changes to them.
- Use this
Resource
to play audio. - Used internally to play audio on the current “audio device”
- Asset controlling the playback of a sound
- A source of audio data
- Stores the position data of the input devices of type
T
. - A spline interpolated continuously across the nearest four control points. The curve does not pass through any of the control points.
- A 2-dimensional
bool
vector mask. - A 3-dimensional
bool
vector mask. - A 4-dimensional
bool
vector mask. - The background color of the node
- A spline composed of a series of cubic Bezier curves.
- Marker struct for buttons
- A UI node that is a button
- The calculated clip of the node
- The calculated size of the node
- The defining component for camera entities, storing information about how and what to render through this camera.
- Configuration for the “main 3d render graph”.
- A spline interpolated continuously across the nearest four control points, with the position of the curve specified at every control point and the tangents computed automatically.
- ChangeTrackersDeprecated
WorldQuery
that tracks changes and additions for componentT
. - A filter on a component that only retains results added or mutably dereferenced after the system last ran.
- Struct for building children onto an entity
- Contains references to the child entities of this entity.
- Command that clear all children from an entity.
- A
Resource
that stores the color that is used to clear the screen between frames. - A 2d material that renders 2d meshes with a texture tinted by a uniform color
- Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering
- A segment of a cubic curve, used to hold precomputed coefficients for fast interpolation.
- An event that is sent whenever the user’s cursor enters a window.
- An event that is sent whenever the user’s cursor leaves a window.
- An event reporting that the mouse cursor has moved inside a window.
- Convenient query for giving a human friendly name to an entity.
- This plugin group will add all the default plugins for a Bevy application:
- A
SystemParam
that stores a buffer which gets applied to theWorld
duringapply_system_buffers
. This is used internally byCommands
to deferWorld
mutations. - Despawns the given entity’s children recursively
- Despawns the given entity and all its children recursively
- A Directional light.
- A component bundle for
DirectionalLight
entities. - A collection of serializable dynamic entities, each with its own run-time defined set of components. To spawn a dynamic scene, you can use either:
- A
DynamicScene
builder, used to build a scene from aWorld
by extracting some entities. - A component bundle for a
DynamicScene
root. - Lightweight identifier of an entity.
- Path to an entity, with
Name
s. Each entity in a path must have a name. - Environment map based ambient lighting representing light from distant scenery.
- Reads events of type
T
in order and tracks which events have already been read. - Sends events of type
T
. - An event collection that represents the events that occurred within the last two
Events::update
calls. Events can be written to using anEventWriter
and are typically cheaply read using anEventReader
. - Schedule which extract data from the main world and inserts it into the render world.
- The amount of time that must pass before the fixed timestep schedule is run again.
- Configures the “classic” computer graphics distance fog effect, in which objects appear progressively more covered in atmospheric haze the further away they are from the camera. Affects meshes rendered via the PBR
StandardMaterial
. - Adds frame counting functionality to Apps.
- A gamepad with an associated
ID
. - An axis of a
Gamepad
. - A button of a
Gamepad
. - A collection of connected
Gamepad
s. - Describe the position of an entity relative to the reference frame.
- A handle into a specific
Asset
of typeT
. - A non-generic version of
Handle
. - A spline interpolated continuously between the nearest two control points, with the position and velocity of the curve specified at both control points. This curve passes through all control points, with the specified velocity which includes direction and parametric speed.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A UI node that is an image
- Adds the
Image
as an asset and makes sure that they are extracted and prepared for the GPU. - Wrapper type to mark a
SystemParam
as an input. - A “press-able” input of type
T
. - Command that inserts a child at a given index of a parent’s children, shifting following children back
- Marker struct for labels
- A system local
SystemParam
. - A 2x2 column major matrix.
- A 3x3 column major matrix.
- A 4x4 column major matrix.
- Adds the necessary ECS resources and render logic to enable rendering entities using the given
Material
asset type. - This plugin group will add the minimal plugins for a Bevy application:
- Unique mutable borrow of an entity’s component
- Component used to identify an entity. Stores a hash for faster comparisons.
- The next state of
State<S>
. - Describes the size of a UI node
- The basic UI node
- Shared borrow of a non-
Send
resource. - Unique borrow of a non-
Send
resource. - A
SystemSet
that will run withinCoreSet::Update
when this state is active. - A filter that tests if any of the given filters apply.
- Project a 3D space onto a 2D surface using parallel lines, i.e., unlike
PerspectiveProjection
, the size of objects remains the same regardless of their distance to the camera. - An alternative to
Commands
that can be used in parallel contexts, such as those inQuery::par_iter
- A collection of potentially conflicting
SystemParam
s allowed by disjoint access. - Holds a reference to the parent entity of this entity. This component should only be present on entities that actually have a parent entity.
- A 3D camera projection in which distant objects appear smaller than close objects.
- Settings to control playback from the start.
- A light that emits light in all directions from a central point.
- A component bundle for
PointLight
entities. - Command that pushes children to the end of the entity’s
Children
. - A quaternion representing an orientation.
- Provides scoped access to a
World
state according to a givenWorldQuery
and query filter. - A ray is an infinite line starting at
origin
, going indirection
. - An event that is sent whenever a window receives a character from the OS or underlying system.
- A rectangle defined by two opposite corners.
- Shared borrow of an entity’s component with access to change detection. Similar to
Mut
but is immutable and so doesn’t require unique access. - A struct used to operate on reflected
Component
of a type. - A struct used to provide the default value of a type.
- A struct used to deserialize reflected instances of a type.
- A struct used to operate on reflected
Resource
of a type. - A struct used to serialize reflected instances of a type.
- Command that removes children from an entity, and removes that child’s parent.
- Command that removes the parent of an entity, and removes that entity from the parent’s
Children
. - Command that clear all children from an entity. And replace with the given children.
- Shared borrow of a
Resource
. - Unique mutable borrow of a
Resource
. - The scan code of a
KeyboardInput
. - To spawn a scene, you can use either:
- A component bundle for a
Scene
root. - A collection of systems, and the metadata and executor needed to run them in a certain order under certain conditions.
- Resource that stores
Schedule
s mapped toScheduleLabel
s. - A shader, as defined by its
ShaderSource
andShaderStage
This is an “unprocessed” shader. It can contain preprocessor directives. - A 2-dimensional area defined by a width and height.
- Asset controlling the playback of a sound, or the locations of its listener and emitter.
- A light that emits light in a given direction from a central point. Behaves like a point light in a perfectly absorbent housing that shines light only in a given direction. The direction is taken from the transform, and can be specified with
Transform::looking_at
. - A component bundle for spot light entities
- A Bundle of components for drawing a single sprite from a sprite sheet (also referred to as a
TextureAtlas
) - A material with “standard” properties used in PBR lighting Standard property values with pictures here https://google.github.io/filament/Material%20Properties.pdf.
- A finite-state machine whose transitions have associated schedules ([
OnEnter(state)
] and [OnExit(state)
]). - Describes the style of a UI node
- Helper for configuring and creating the default task pools. For end-users who want full control, set up
TaskPoolPlugin
- Setup of default task pools:
AsyncComputeTaskPool
,ComputeTaskPool
,IoTaskPool
. - The bundle of components needed to draw text in a 2D scene via a 2D
Camera2dBundle
. Example usage. - A UI node that is text
- An atlas containing multiple textures (like a spritesheet or a tilemap). Example usage animating sprite. Example usage loading sprite sheet.
- A builder which is used to create a texture atlas from many individual sprites.
- A clock that tracks how much it has advanced (and how much real time has elapsed) since its previous update and since its creation.
- Tracks elapsed time. Enters the finished state once
duration
is reached. - A touch input event.
- A collection of
Touch
es. - Describe the position of an entity. If the entity has a parent, the position is relative to its parent position.
- The base plugin for handling
Transform
components - Registration of default types to the
TypeRegistry
resource. - A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- Configuration for cameras related to UI.
- The 2D texture displayed for this UI node
- A type which is commonly used to define positions, margins, paddings and borders.
- The current scale of the UI.
- Print a warning for each
Entity
with aT
component whose parent doesn’t have aT
component. - Describes how an attribute of a
Transform
should be animated. - A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector with SIMD support.
- A
Bundle
of theVisibility
andComputedVisibility
Component
s, which describe the visibility of an entity. - Define how a window will be created and how it will behave.
- An event that is sent when a window is repositioned in physical pixels.
- A
Plugin
that defines an interface for windowing support in Bevy. - The size limits on a window.
- Filter that selects entities with a component
T
. - Filter that selects entities without a component
T
. - Stores and exposes operations on entities, components, resources, and their associated metadata.
- Struct for adding children to an entity directly through the
World
for use in exclusive systems
Enums
- Defines how each line is aligned within the flexbox.
- How items are aligned according to the cross axis
- How this item is aligned according to the cross axis. Overrides
AlignItems
. - Sets how a material’s base color alpha channel is used for transparency.
- Events that involve assets of type
T
. - The names of the default
App
schedules. - The names of the default
App
system sets. - The icon to display for a window’s cursor.
- Defines the text direction
- Whether to use a Flexbox layout model.
- Euler rotation sequences.
- Events related to files being dragged and dropped on a window.
- Defines how flexbox items are ordered within a flexbox
- Defines if flexbox items appear on a single line or on multiple lines
- Allows switching between different fog falloff modes, and configuring their parameters.
- A type of a
GamepadAxis
. - A type of a
GamepadButton
. - A Input Method Editor event.
- Describes what type of input interaction has occurred for a UI node.
- Defines how items are aligned according to the main axis
- The key code of a
KeyboardInput
. - List of keyframes for one of the attribute of a
Transform
. - Defines which monitor to use.
- A button on a mouse device.
- Configuration resource for Multi-Sample Anti-Aliasing.
- Whether to show or hide overflowing items
- The strategy used to position this node
- A configurable
CameraProjection
that can select its projection type at runtime. - The names of the default
App
startup sets, which live inCoreSchedule::Startup
. - Describes horizontal alignment preference for positioning & bounds.
- Specifies
Timer
behavior. - An enum that describes possible types of value in flexbox layout options
- User indication of whether an entity is visible. Propagates down the entity hierarchy.
- Defines where window should be placed at on creation.
- Indicates that this
Node
entity’s front-to-back ordering is not controlled solely by its location in the UI hierarchy. A node with a higher z-index will appear on top of other nodes with a lower z-index.
Traits
App
extension methods for adding new asset types.- Common interactions with an audio sink.
- Trait defining how to build children
- Collection of methods similar to [
BuildChildren
], but preserving each entity’sGlobalTransform
. - Trait that defines adding children to an entity directly through the
World
- The
Bundle
trait enables insertion and removal ofComponent
s from an entity. - A data type that can be used to store data for an entity.
- A system that determines if one or more scheduled systems should run.
- Implement this on cubic splines that can generate a curve from their spline parameters.
- A type implementing this trait can be converted to a
rodio::Source
type. It must beSend
andSync
, and usually implementsAsset
so needs to beTypeUuid
, in order to be registered. Types that implement this trait usually contain raw sound data that can be converted into an iterator of samples. This trait is implemented forAudioSource
. Check the exampleaudio/decodable
for how to implement this trait on a custom type. - Trait that holds functions for despawning recursively down the transform hierarchy
- Types that can read change detection information. This change detection is controlled by
DetectChangesMut
types such asResMut
. - Types that implement reliable change detection.
- A type that can be stored in an
Events<E>
resource You can conveniently access events using theEventReader
andEventWriter
system parameter. - A trait that enables types to be dynamically constructed from reflected data.
- Creates an instance of the type this trait is implemented for using data from the supplied World.
- A convenience trait which combines fetching and downcasting of struct fields.
- A convenience trait which combines fetching and downcasting of tuple struct fields.
- An extension trait for
Query
that adds hierarchy related methods. - An extension trait providing the
IntoPipeSystem::pipe
method to pass input from one system into the next. - Conversion trait to turn something into a
System
. - Types that can be converted into a
SystemAppConfig
. - Types that can convert into
SystemAppConfigs
. - Types that can be converted into a
SystemConfig
. - Types that can convert into a
SystemConfigs
. - Types that can be converted into a
SystemSet
. - Types that can be converted into a
SystemSetConfig
. - Types that can convert into a
SystemSetConfigs
. - Materials are used alongside
MaterialPlugin
andMaterialMeshBundle
to spawn entities that are rendered with a specificMaterial
type. They serve as an easy to use high level way to renderMesh
entities with custom shader logic. - A collection of Bevy app logic and configuration.
- Combines multiple
Plugin
s into a single unit. - The core trait of
bevy_reflect
, used for accessing and modifying data dynamically. - A type that can be inserted into a
World
as a singleton. - Types that can define world-wide states in a finite-state machine.
- A trait used to power struct-like operations via reflection.
- An ECS system that can be added to a
Schedule
- A trait implemented for all functions that can be used as
System
s. - Types that identify logical groups of systems.
- A trait used to power tuple struct-like operations via reflection.
Functions
- Generates a
Condition
-satisfying closure that returnstrue
if there are any entities with the given component type. - If a new state is queued in
NextState<S>
, this system: - Instructs the executor to call
apply_buffers
on the systems that have run but not applied their buffers. - System adapter that utilizes the
bevy_utils::tracing::debug!
macro to print the output of a system. - An ergonomic abbreviation for
Default::default()
to make initializing structs easier. This is especially helpful when combined with “struct update syntax”. - Function for despawning an entity and all its children
- System adapter that utilizes the
bevy_utils::tracing::error!
macro to print the output of a system. - System adapter that ignores the output of the previous system in a pipe. This is useful for fallible systems that should simply return early in case of an
Err
/None
. - Generates a
Condition
-satisfying closure that returnstrue
if the state machine is currently instate
. - System adapter that utilizes the
bevy_utils::tracing::info!
macro to print system information. - Generates a
Condition
that inverses the result of passed one. - Generates a
Condition
-satisfying closure that returnstrue
if there are any new events of the given type since it was last called. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has been added since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource exists. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has had its value changed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the resource exists and is equal tovalue
. - Generates a
Condition
-satisfying closure that returnstrue
if the resource of the given type has been removed since the condition was last checked. - Generates a
Condition
-satisfying closure that returnstrue
if the first time the condition is run and false every time after - Generates a
Condition
-satisfying closure that returnstrue
if the state machine changed state. - Generates a
Condition
-satisfying closure that returnstrue
if the state machine exists. - Generates a
Condition
-satisfying closure that returnstrue
if the state machine exists and is currently instate
. - Defines how
min_size
,size
, andmax_size
affects the bounds of a text block. - Updates the layout and size information whenever the text or style is changed. This information is computed by the
TextPipeline
on insertion, then stored. - System adapter that unwraps the
Ok
variant of aResult
. This is useful for fallible systems that should panic in the case of an error. - Updates calculated size of the node based on the image provided
- System adapter that utilizes the
bevy_utils::tracing::warn!
macro to print the output of a system.
Type Definitions
- A component bundle for entities with a
Mesh2dHandle
and aColorMaterial
. - A component bundle for PBR entities with a
Mesh
and aStandardMaterial
.
Attribute Macros
- A macro that automatically generates type data for traits, which their implementors can then register.
Derive Macros
- Generates a dynamic plugin entry point function for the given
Plugin
type. - Derives the
FromReflect
trait. - The main derive macro used by
bevy_reflect
for deriving itsReflect
trait. - Derive macro generating an impl of the trait
SystemSet
.