Module bevy::prelude

source ·
Expand description

use bevy::prelude::*; to import common components, bundles, and plugins.

Modules§

  • Constants for operating with the light units: lumens, and lux.

Macros§

Structs§

  • The GizmoConfigGroup used for debug visualizations of Aabb components on entities
  • A filter on a component that only retains results the first time after they have been added.
  • An ambient light, which lights the entire scene equally.
  • An Iterator of Entitys over the ancestors of an Entity.
  • A list of VariableCurves and the AnimationTargetIds to which they apply.
  • A graph structure that describes how animation clips are to be blended together.
  • An AssetLoader that can load AnimationGraphs as assets.
  • An individual node within an animation graph.
  • Animation controls
  • Adds animation support to an app
  • An animation that is being faded out as part of a transition
  • Manages fade-out of animation blend factors, allowing for smooth transitions between animations.
  • A primitive shape formed by the region between two circles, also known as a ring.
  • The AnyOf query parameter fetches entities with any of the component types included in T.
  • App is the primary API for writing user applications. It automates the setup of a standard lifecycle and provides interface glue for plugins.
  • A Resource storing TypeRegistry for type registrations relevant to a whole app.
  • A primitive representing an arc between two points on a circle.
  • Provides “asset” loading and processing functionality. An Asset is a “runtime value” that is loaded from an AssetSource, which can be something like a filesystem, a network, etc.
  • Loads and tracks the state of Asset values from a configured AssetReader. This can be used to kick off new asset loads and retrieve their current load states.
  • Stores Asset values identified by their AssetId.
  • A UI node that is a texture atlas sprite
  • Used to control audio during playback.
  • A source of audio data
  • Bundle for playing a sound.
  • Stores the position data of the input devices of type T.
  • A 2-dimensional bool vector mask.
  • A 3-dimensional bool vector mask.
  • A 4-dimensional bool vector mask.
  • The background color of the node
  • An individual input for Animatable::blend.
  • The border color of the UI node.
  • Used to add rounded corners to a UI node. You can set a UI node to have uniformly rounded corners or specify different radii for each corner. If a given radius exceeds half the length of the smallest dimension between the node’s height or width, the radius will calculated as half the smallest dimension.
  • Struct defining a Sprite border with padding values
  • A polygon with a variable number of vertices, allocated on the heap in a Box<[Vec2]>.
  • A series of connected line segments in 2D space, allocated on the heap in a Box<[Vec2]>.
  • A series of connected line segments in 3D space, allocated on the heap in a Box<[Vec3]>.
  • Marker struct for buttons
  • A UI node that is a button
  • A “press-able” input of type T.
  • The calculated clip 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”. The camera coordinate space is right-handed x-right, y-up, z-back. This means “forward” is -Z.
  • The camera coordinate space is right-handed x-right, y-up, z-back. This means “forward” is -Z.
  • A 2D capsule primitive, also known as a stadium or pill shape.
  • A 3D capsule primitive. A three-dimensional capsule is defined as a surface at a distance (radius) from a line
  • A filter on a component that only retains results the first time after they have been added or mutably dereferenced.
  • Struct for building children entities and adding them to a parent entity.
  • Contains references to the child entities of this entity.
  • A circle primitive
  • A primitive representing a circular sector: a pie slice of a circle.
  • A primitive representing a circular segment: the area enclosed by the arc of a circle and its chord (the line between its endpoints).
  • Command that clears all children from an entity and removes Parent component from those children.
  • 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
  • A Command queue to perform structural changes to the World.
  • A cone primitive centered on the midpoint between the tip of the cone and the center of its base.
  • A conical frustum primitive. A conical frustum can be created by slicing off a section of a cone.
  • A spline interpolated continuously across the nearest four control points. The curve does not pass through any of the control points.
  • A spline composed of a single cubic Bezier curve.
  • 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. The associated CubicCurve has one segment between each pair of adjacent control points.
  • A collection of CubicSegments chained into a single parametric curve. Has domain [0, N) where N is the number of attached segments.
  • 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.
  • Non-uniform Rational B-Splines (NURBS) are a powerful generalization of the CubicBSpline which can represent a much more diverse class of curves (like perfect circles and ellipses).
  • A segment of a cubic curve, used to hold precomputed coefficients for fast interpolation. Can be evaluated as a parametric curve over the domain [0, 1).
  • A cuboid primitive, more commonly known as a box.
  • 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.
  • A cylinder primitive
  • Convenient query for giving a human friendly name to an entity.
  • The default gizmo config group.
  • This plugin group will add all the default plugins for a Bevy application:
  • A SystemParam that stores a buffer which gets applied to the World during apply_deferred. This is used internally by Commands to defer World mutations.
  • An Iterator of Entitys over the descendants of an Entity.
  • Despawns the given entity’s children recursively
  • Despawns the given entity and all its children recursively
  • A normalized vector pointing in a direction in 2D space
  • A normalized vector pointing in a direction in 3D space
  • A normalized SIMD vector pointing in a direction in 3D space.
  • A Directional light.
  • A component bundle for DirectionalLight entities.
  • A collection of serializable resources and dynamic entities.
  • A DynamicScene builder, used to build a scene from a World by extracting some entities and resources.
  • A component bundle for a DynamicScene root.
  • An ellipse primitive
  • System set that runs enter schedule(s) for state S.
  • Lightweight identifier of an entity.
  • Provides mutable access to a single entity and all of its components.
  • A read-only reference to a particular Entity and all of its components.
  • A mutable reference to a particular Entity, and the entire world. This is essentially a performance-optimized (Entity, &mut World) tuple, which caches the EntityLocation to reduce duplicate lookups.
  • A pair of cubemap textures that represent the surroundings of a specific area in space.
  • 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 an EventWriter and are typically cheaply read using an EventReader.
  • System set that runs exit schedule(s) for state S.
  • Schedule which extract data from the main world and inserts it into the render world.
  • A 3D shape representing an extruded 2D base_shape.
  • Runs first in the schedule.
  • The fixed timestep game clock following virtual time.
  • Runs first in the FixedMain schedule.
  • The schedule that runs last in FixedMain
  • The schedule that runs after the FixedUpdate schedule, for reacting to changes made in the main update logic.
  • The schedule that contains logic that must run before FixedUpdate.
  • The schedule that contains most gameplay logic.
  • 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 Gamepads.
  • Plugin that provides gamepad handling to an App.
  • A struct that stores configuration for gizmos.
  • A Resource storing GizmoConfig and GizmoConfigGroup structs
  • A SystemParam for drawing gizmos.
  • Describe the position of an entity relative to the reference frame.
  • Use this Resource to control the global volume of all audio.
  • Representation of a loaded glTF file.
  • Additional untyped data that can be present on most glTF types at the primitive level.
  • Represents the position of a grid item in a single axis.
  • A GridTrack is a Row or Column of a CSS Grid. This struct specifies what size the track should be. See below for the different “track sizing functions” you can specify.
  • Returns a bool that describes if an entity has the component T.
  • Provides hierarchy functionality to a Bevy app.
  • Color in Hue-Saturation-Lightness (HSL) color space with alpha. Further information on this color model can be found on Wikipedia.
  • Color in Hue-Saturation-Value (HSV) color space with alpha. Further information on this color model can be found on Wikipedia.
  • Color in Hue-Whiteness-Blackness (HWB) color space with alpha. Further information on this color model can be found on Wikipedia.
  • A rectangle defined by two opposite corners.
  • 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.
  • An unbounded plane in 3D space. It forms a separating surface through the origin, stretching infinitely far
  • Whether or not an entity is visible in the hierarchy. This will not be accurate until VisibilityPropagate runs in the PostUpdate schedule.
  • Command that inserts a child at a given index of a parent’s children, shifting following children back.
  • Marker used to identify default cameras, they will have priority over the PrimaryWindow camera.
  • Color in LAB color space, with alpha
  • Marker struct for labels
  • Runs last in the schedule.
  • Color in LCH color space, with alpha
  • The GizmoConfigGroup used to configure the visualization of lights.
  • A marker component for a light probe, which is a cuboid region that provides global illumination to all fragments inside it.
  • An infinite line along a direction in 2D space.
  • An infinite line along a direction in 3D space.
  • Linear RGB color with alpha.
  • A system local SystemParam.
  • The schedule that contains the app logic that is evaluated each tick of App::update().
  • A 2x2 column major matrix.
  • A 3x3 column major matrix.
  • A 4x4 column major matrix.
  • A component bundle for entities with a Mesh and a Material.
  • A UI node that is rendered using a UiMaterial
  • Adds the necessary ECS resources and render logic to enable rendering entities using the given Material asset type.
  • A 3D object made out of vertices representing triangles, lines, or points, with “attribute” values for each vertex.
  • This plugin group will add the minimal plugins for a Bevy application:
  • Controls the morph targets for all child Handle<Mesh> entities. In most cases, MorphWeights should be considered the “source of truth” when writing morph targets for meshes. However you can choose to write child MeshMorphWeights if your situation requires more granularity. Just note that if you set MorphWeights, it will overwrite child MeshMorphWeights values.
  • Unique mutable borrow of an entity’s component or of a resource.
  • Component used to identify an entity. Stores a hash for faster comparisons.
  • Base component for a UI node, which also provides the computed size of the node.
  • The basic UI node.
  • Shared borrow of a non-Send resource.
  • Unique borrow of a non-Send resource.
  • An Observer system. Add this Component to an Entity to turn it into an “observer”.
  • Color in Oklab color space, with alpha
  • Color in Oklch color space, with alpha
  • Trigger emitted when a component is added to an entity.
  • The label of a Schedule that only runs whenever State<S> enters the provided state.
  • The label of a Schedule that only runs whenever State<S> exits the provided state.
  • Trigger emitted when a component is inserted on to to an entity.
  • Trigger emitted when a component is removed from an entity.
  • The label of a Schedule that only runs whenever State<S> exits AND enters the provided exited and entered states.
  • 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.
  • The Outline component adds an outline outside the edge of a UI node. Outlines do not take up space in the layout.
  • Whether to show or hide overflowing items
  • An alternative to Commands that can be used in parallel contexts, such as those in Query::par_iter
  • A collection of potentially conflicting SystemParams 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.
  • A source of sine wave sound
  • An unbounded plane in 2D space. It forms a separating surface through the origin, stretching infinitely far
  • A bounded plane in 3D space. It forms a surface starting from the origin with a defined height and width.
  • Initial settings to be used when audio starts playing. If you would like to control the audio while it is playing, query for the AudioSink or SpatialAudioSink components. Changes to this component will not be applied to already-playing audio.
  • A light that emits light in all directions from a central point.
  • A component bundle for PointLight entities.
  • A polygon with N vertices.
  • A series of connected line segments in 2D space.
  • A series of connected line segments in 3D space.
  • The schedule that runs once after Startup.
  • The schedule that contains logic that must run after Update. For example, synchronizing “local transforms” in a hierarchy to “global” absolute transforms. This enables the PostUpdate transform-sync system to react to “local transform” changes in Update without the Update systems needing to know about (or add scheduler dependencies for) the “global transform sync system”.
  • The schedule that runs before Startup.
  • The schedule that contains logic that must run before Update. For example, a system that reads raw keyboard input OS events into an Events resource. This enables systems in Update to consume the events from the Events resource without actually knowing about (or taking a direct scheduler dependency on) the “os-level keyboard event system”.
  • Command that adds a child to an entity.
  • Command that pushes children to the end of the entity’s Children.
  • A quaternion representing an orientation.
  • System parameter that provides selective access to the Component data stored in a World.
  • Builder struct to create QueryState instances at runtime.
  • Provides scoped access to a World state according to a given QueryData and QueryFilter.
  • A collection of RationalSegments chained into a single parametric curve.
  • A segment of a rational cubic curve, used to hold precomputed coefficients for fast interpolation. Can be evaluated as a parametric curve over the domain [0, knot_span).
  • An infinite half-line starting at origin and going in direction in 2D space.
  • An infinite half-line starting at origin and going in direction in 3D space.
  • Real time clock representing elapsed wall clock time.
  • An event that is sent whenever a window receives a character from the OS or underlying system.
  • A rectangle defined by two opposite corners.
  • A rectangle primitive
  • 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 trait of a type.
  • A struct used to provide the default value of a type.
  • A struct used to deserialize reflected instances of a type.
  • Type data that represents the FromReflect trait and allows it to be used dynamically.
  • A struct used to operate on the reflected FromWorld trait of a type.
  • A struct used to operate on reflected Resource of a type.
  • A struct used to serialize reflected instances of a type.
  • A bundle that contains everything needed to make an entity a reflection probe.
  • A polygon where all vertices lie on a circle, equally far apart.
  • Command that removes children from an entity, and removes these children’s parent.
  • Command that removes the parent of an entity, and removes that entity from the parent’s Children.
  • A SystemParam that yields entities that had their T Component removed or have been despawned with it.
  • Represents a possibly repeated GridTrack.
  • Command that clear all children from an entity, replacing them with the given children.
  • Shared borrow of a Resource.
  • Unique mutable borrow of a Resource.
  • A rhombus primitive, also known as a diamond shape.
  • A counterclockwise 2D rotation.
  • Updates the running gamepad rumble effects.
  • To spawn a scene, you can use either:
  • A component bundle for a Scene root.
  • Handles spawning and despawning scenes in the world, either synchronously or batched through the scene_spawner_system.
  • A collection of systems, and the metadata and executor needed to run them in a certain order under certain conditions.
  • Resource that stores Schedules mapped to ScheduleLabels excluding the current running Schedule.
  • Plugin for screen space ambient occlusion.
  • A segment of a line along a direction in 2D space.
  • A segment of a line along a direction in 3D space.
  • A version of AnimationGraph suitable for serializing as an asset.
  • A version of AnimationGraphNode suitable for serializing as an asset.
  • A shader, as defined by its ShaderSource and ShaderStage This is an “unprocessed” shader. It can contain preprocessor directives.
  • Add this Component to an entity to draw its Aabb component.
  • Add this Component to an entity to draw any of its lights components (PointLight, SpotLight and DirectionalLight).
  • Used to control spatial audio during playback.
  • A Bundle that allows the correct positional rendering of an entity.
  • Settings for the listener for spatial audio sources.
  • The schedule that contains scene spawning.
  • A sphere primitive
  • 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
  • Specifies the rendering properties of a sprite.
  • A Bundle of components for drawing a single sprite from an image.
  • A Bundle of components for drawing a single sprite from a sprite sheet (also referred to as a TextureAtlas) or for animated sprites.
  • Non-linear standard RGB with alpha.
  • A material with “standard” properties used in PBR lighting Standard property values with pictures here https://google.github.io/filament/Material%20Properties.pdf.
  • The schedule that runs once when the app starts.
  • A finite-state machine whose transitions have associated schedules (OnEnter(state) and OnExit(state)).
  • Entities marked with this component will be removed when the world’s state of the matching type no longer matches the supplied value.
  • Event sent when any state transition of S happens. This includes identity transitions, where exited and entered have the same value.
  • Describes the style of a UI container node
  • A secondary application with its own World. These can run independently of each other.
  • Builder struct used to construct state for SystemParam passed to a system.
  • Indicates that this root Node entity should be rendered to a specific camera. UI then will be laid out respecting the camera’s viewport and scale factor, and rendered to this camera’s bevy_render::camera::RenderTarget.
  • 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.
  • A tetrahedron primitive.
  • The bundle of components needed to draw text in a 2D scene via a 2D Camera2dBundle. Example usage.
  • A UI node that is text
  • Component used to draw a specific section of a texture.
  • A builder which is used to create a texture atlas from many individual sprites.
  • 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.
  • Single texture slice, representing a texture rect to draw in a given area
  • 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.
  • A generic clock resource that tracks how much it has advanced since its previous update and since its creation.
  • Tracks elapsed time. Enters the finished state once duration is reached.
  • A torus primitive, often representing a ring or donut shape
  • A touch input event.
  • A collection of Touches.
  • Describe the position of an entity. If the entity has a parent, the position is relative to its parent position.
  • A Bundle of the Transform and GlobalTransform [Component]s, which describe the position of an entity.
  • System parameter for computing up-to-date GlobalTransforms.
  • The base plugin for handling Transform components
  • System set that runs transition schedule(s) for state S.
  • A triangle in 2D space
  • A 3D triangle primitive.
  • Type containing triggered Event information for a given run of an Observer. This contains the Event data itself. If it was triggered for a specific Entity, it includes that as well.
  • Registration of default types to the TypeRegistry resource.
  • A rectangle defined by two opposite corners.
  • A 2-dimensional vector.
  • A 3-dimensional vector.
  • A 4-dimensional vector.
  • The 2D texture displayed for this UI node
  • Adds the necessary ECS resources and render logic to enable rendering entities using the given UiMaterial asset type (which includes UiMaterial types).
  • A type which is commonly used to define margins, paddings and borders.
  • The current scale of the UI.
  • The schedule that contains app logic. Ideally containing anything that must run once per render frame, such as UI.
  • Print a warning for each Entity with a T component whose parent doesn’t have a T component.
  • Describes how an attribute of a Transform or MorphWeights should be animated.
  • A 2-dimensional vector.
  • A 3-dimensional vector.
  • A 4-dimensional vector.
  • Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering.
  • The virtual game clock representing game time.
  • A Bundle of the Visibility, InheritedVisibility, and ViewVisibility Components, which describe the visibility of an entity.
  • The defining Component for window entities, storing information about how it should appear and 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.
  • CIE 1931 color space, also known as XYZ, with an alpha channel.

Enums§

Traits§

Functions§

Type Aliases§

Attribute Macros§

  • A macro that automatically generates type data for traits, which their implementors can then register.

Derive Macros§