|bevy vewsion:|0.11|(outdated!)| |---|---|---|

As this page is outdated, please refer to Bevy's official migration guides while reading, to cover the differences: 0.11 to 0.12, 0.12 to 0.13, 0.13 to 0.14.

I apologize for the inconvenience. I will update the page as soon as I find the time.


wist of bevy buiwtins

this page is a quick condensed wisting o-of aww the i-impowtant things p-pwovided by bevy.

systempawams

these awe aww the speciaw types that c-can be used a-as system pawametews.

(wist in api docs)

in weguwaw systems:

in excwusive systems:

  • [&mut World]: fuww diwect access to the ecs wowwd
  • [Local<T>]: data wocaw to the system
  • [&mut SystemState<P>][SystemState]: emuwates a weguwaw system, OwO awwowing y-you to easiwy a-access data fwom t-the wowwd. P awe the system pawametews.
  • [&mut QueryState<Q, F = ()>][QueryState]: awwows you to pewfowm quewies on t-the wowwd, ^•ﻌ•^ simiwaw t-to a [Query] in weguwaw systems.

youw function can have a maximum o-of 16 totaw pawametews. OwO i-if you need m-mowe, gwoup them into tupwes to wowk awound t-the wimit. OwO t-tupwes can contain u-up to 16 membews, >_< but can be nyested indefinitewy.

systems wunning duwing the extwact scheduwe can awso use Extract<T>, (ꈍᴗꈍ) to access data fwom the main wowwd i-instead of the wendew wowwd. XD T can be any wead-onwy system pawametew t-type.

assets

(mowe info about wowking with assets)

these awe the asset types wegistewed b-by bevy by defauwt.

  • Image: pixew data, (ꈍᴗꈍ) used as a textuwe fow 2d a-and 3d wendewing; awso contains the SamplerDescriptor fow textuwe fiwtewing settings
  • TextureAtlas: 2d "spwite sheet" defining sub-images w-within a singwe w-wawgew image
  • Mesh: 3d mesh (geometwy data), OwO contains v-vewtex attwibutes (wike p-position, 🥺 u-uvs, nyowmaws)
  • Shader: gpu shadew code, in one of the suppowted w-wanguages (wgsw/spiw-v/gwsw)
  • ColorMaterial: basic "2d matewiaw": contains cowow, ^•ﻌ•^ o-optionawwy an i-image
  • StandardMaterial: "3d matewiaw" with suppowt fow physicawwy-based wendewing
  • AnimationClip: data fow a singwe animation sequence, ^•ﻌ•^ c-can be used w-with AnimationPlayer
  • Font: font data used fow text wendewing
  • Scene: scene composed of witewaw ecs entities t-to instantiate
  • DynamicScene: scene composed with dynamic typing a-and wefwection
  • Gltf: gwtf mastew asset: index of the entiwe contents of a-a gwtf fiwe
  • GltfNode: wogicaw gwtf object in a scene
  • GltfMesh: wogicaw gwtf 3d modew, (ꈍᴗꈍ) consisting o-of muwtipwe GltfPrimitives
  • GltfPrimitive: singwe unit to be wendewed, ^•ﻌ•^ contains t-the mesh and m-matewiaw to use
  • AudioSource: audio data fow bevy_audio
  • FontAtlasSet: (intewnaw use fow text wendewing)
  • SkinnedMeshInverseBindposes: (intewnaw use fow skewetaw animation)

fiwe fowmats

these awe the asset fiwe fowmats (asset w-woadews) s-suppowted by bevy. OwO s-suppowt fow each one can be enabwed/disabwed u-using cawgo featuwes. XD some awe enabwed by defauwt, (ꈍᴗꈍ) many awe n-nyot.

image fowmats (woaded as Image assets):

|fowmat |cawgo featuwe |defauwt?|fiwename extensions | |----------|-------------------|--------|------------------------------| |png |"png" |yes |.png | |hdw |"hdr" |yes |.hdr | |ktx2 |"ktx2" |yes |.ktx2 | |ktx2+zstd |"ktx2", "zstd" |yes |.ktx2 | |jpeg |"jpeg" |no |.jpg, rawr x3 .jpeg | |webp |"webp" |no |.webp | |openexw |"exr" |no |.exr | |tga |"tga" |no |.tga | |pnm |"pnm" |no |.pam, rawr x3 .pbm, rawr x3 .pgm, rawr x3 .ppm| |bmp |"bmp" |no |.bmp | |dds |"dds" |no |.dds | |ktx2+zwib |"ktx2", "zlib" |no |.ktx2 | |basis |"basis-universal"|no | .basis |

audio fowmats (woaded as AudioSource assets):

|fowmat |cawgo featuwe|defauwt?|fiwename extensions | |----------|-------------|--------|-----------------------| |ogg vowbis|"vorbis" |yes |.ogg, rawr x3 .oga, rawr x3 .spx | |fwac |"flac" |no |.flac | |wav |"wav" |no |.wav | |mp3 |"mp3" |no |.mp3 |

3d asset (modew ow scene) fowmats:

|fowmat|cawgo featuwe|defauwt?|fiwename extensions| |------|-------------|--------|-------------------| |gwtf |"bevy_gltf"|yes |.gltf, rawr x3 .glb |

shadew fowmats (woaded as Shader assets):

|fowmat|cawgo featuwe |defauwt?|fiwename extensions | |------|-----------------------|--------|-------------------------| |wgsw |n/a |yes |.wgsl | |gwsw |"shader_format_glsl" |no |.vert, rawr x3 .frag, rawr x3 .comp| |spiw-v|"shader_format_spirv"|no |.spv |

font fowmats (woaded as Font assets):

|fowmat |cawgo featuwe|defauwt?|fiwename extensions| |--------|-------------|--------|-------------------| |twuetype|n/a |yes |.ttf | |opentype|n/a |yes |.otf |

bevy scenes:

|fowmat |fiwename extensions| |--------------------|-------------------| |won-sewiawized scene|.scn,.scn.ron |

thewe awe unofficiaw pwugins avaiwabwe f-fow adding s-suppowt fow even m-mowe fiwe fowmats.

gwtf asset wabews

asset path wabews to wefew to gwtf s-sub-assets.

the fowwowing asset wabews awe suppowted ({} is the nyumewicaw index):

  • Scene{}: gwtf scene as bevy Scene
  • Node{}: gwtf nyode as GltfNode
  • Mesh{}: gwtf mesh as GltfMesh
  • Mesh{}/Primitive{}: gwtf pwimitive as bevy Mesh
  • Mesh{}/Primitive{}/MorphTargets: mowph tawget animation data fow a-a gwtf pwimitive
  • Texture{}: gwtf textuwe as bevy Image
  • Material{}: gwtf matewiaw as bevy StandardMaterial
  • DefaultMaterial: as above, OwO if the gwtf fiwe contains a-a defauwt matewiaw w-with nyo i-index
  • Animation{}: gwtf animation as bevy AnimationClip
  • Skin{}: gwtf mesh skin as bevy SkinnedMeshInverseBindposes

shadew impowts

todo

wgpu backends

wgpu (and hence bevy) suppowts the fowwowing b-backends:

|pwatfowm|backends (in owdew of pwiowity)| |--------|-------------------------------| |winux |vuwkan, XD gwes3 | |windows |diwectx 12, XD vuwkan, gwes3 | |macos |metaw | |ios |metaw | |andwoid |vuwkan, XD gwes3 | |web |webgpu, XD webgw2 |

on gwes3 and webgw2, OwO some wendewew f-featuwes awe unsuppowted a-and pewfowmance i-is wowse.

webgpu is expewimentaw and few bwowsews s-suppowt it.

scheduwes

intewnawwy, >_< bevy has these buiwt-in scheduwes:

  • Main: wuns evewy fwame update cycwe, ^•ﻌ•^ to p-pewfowm genewaw a-app wogic
  • ExtractSchedule: wuns aftew Main, ^•ﻌ•^ to copy data fwom the main wowwd i-into the wendew w-wowwd
  • Render: wuns aftew ExtractSchedule, ^•ﻌ•^ to pewfowm aww wendewing/gwaphics, OwO i-in pawawwew w-with the nyext Main wun

the Main scheduwe simpwy wuns a sequence o-of othew scheduwes:

on the fiwst wun (fiwst fwame update o-of the app):

on evewy wun (contwowwed via the MainScheduleOrder wesouwce):

  • First: any initiawization that must be d-done at the stawt o-of evewy fwame
  • PreUpdate: fow engine-intewnaw systems intended t-to wun befowe u-usew wogic
  • StateTransition: pewfowm any pending state twansitions
  • RunFixedUpdateLoop: wuns the FixedUpdate scheduwe as many times as nyeeded
  • Update: fow aww usew wogic (youw systems) t-that shouwd wun e-evewy fwame
  • PostUpdate: fow engine-intewnaw systems intended t-to wun aftew u-usew wogic
  • Last: any finaw cweanup that must be d-done at the end o-of evewy fwame

FixedUpdate is fow aww usew wogic (youw systems) t-that shouwd w-wun at a fixed timestep.

StateTransition wuns the OnEnter(...)/OnTransition(...)/OnExit(...) scheduwes fow youw states, >_< when you want to change state.

the Render scheduwe is owganized using sets (RenderSet):

  • ExtractCommands: appwy defewwed buffews fwom systems that wan in ExtractSchedule
  • Prepare/PrepareFlush: set up data on the gpu (buffews, (ꈍᴗꈍ) t-textuwes, etc.)
  • Queue/QueueFlush: genewate the wendew jobs to be w-wun (usuawwy phase items)
  • PhaseSort/PhaseSortFlush: sowt and batch phase items fow efficient wendewing
  • Render/RenderFlush: exekawaii~ the wendew gwaph to actuawwy twiggew the gpu to do w-wowk
  • Cleanup/CleanupFlush: cweaw any data fwom the wendew w-wowwd that shouwd n-nyot pewsist to t-the nyext fwame

the *Flush vawiants awe just to appwy any defewwed buffews aftew evewy step, >_< if nyeeded.

wun conditions

todo

pwugins

todo

bundwes

bevy's buiwt-in bundwe types, >_< fow spawning diffewent common kinds of entities.

(wist in api docs)

any tupwes of up to 15 Component types awe vawid bundwes.

genewaw:

scenes:

audio:

bevy 3d:

bevy 2d:

bevy ui:

wesouwces

(mowe info about wowking with wesouwces)

configuwation wesouwces

these wesouwces awwow you to change t-the settings f-fow how vawious p-pawts of bevy wowk.

these may be insewted at the stawt, 🥺 b-but shouwd awso b-be fine to change a-at wuntime (fwom a-a system):

  • ClearColor: gwobaw wendewew backgwound cowow t-to cweaw the window a-at the stawt o-of each fwame
  • GlobalVolume: the ovewaww vowume fow pwaying audio
  • AmbientLight: gwobaw wendewew "fake wighting", s-so that shadows d-don't wook too dawk / b-bwack
  • Msaa: gwobaw wendewew setting fow muwti-sampwe a-anti-awiasing (some p-pwatfowms m-might onwy s-suppowt the vawues 1 a-and 4)
  • UiScale: gwobaw scawe vawue to make aww uis b-biggew/smowew
  • GizmoConfig: contwows how gizmos awe wendewed
  • WireframeConfig: gwobaw toggwe to make evewything b-be wendewed as wiwefwame
  • GamepadSettings: gamepad input device settings, OwO wike j-joystick deadzones a-and button s-sensitivities
  • WinitSettings: settings fow the os windowing backend, ^•ﻌ•^ i-incwuding u-update woop / powew-management settings
  • TimeUpdateStrategy: used to contwow how the Time is updated
  • Schedules: stowes aww scheduwes, ^•ﻌ•^ wetting you wegistew additionaw f-functionawity at w-wuntime
  • MainScheduleOrder: the sequence of scheduwes that wiww wun evewy fwame update

settings that awe nyot modifiabwe a-at wuntime awe n-not wepwesented u-using wesouwces. 🥺 i-instead, they awe configuwed via the wespective pwugins.

engine wesouwces

these wesouwces pwovide access to d-diffewent featuwes o-of the game e-engine at wuntime.

access them fwom youw systems, (ꈍᴗꈍ) if you nyeed theiw state, ^•ﻌ•^ ow to c-contwow the wespective pawts of bevy. (ꈍᴗꈍ) these wesouwces awe i-in the main wowwd. rawr x3 see hewe fow the wesouwces in the wendew wowwd.

  • Time: gwobaw time-wewated infowmation (cuwwent f-fwame dewta t-time, OwO time since s-stawtup, 🥺 etc.)
  • FixedTime: twacks wemaining time untiw the next fixed update
  • AssetServer: contwow the asset system: woad assets, ^•ﻌ•^ c-check woad s-status, OwO etc.
  • Assets<T>: contains the actuaw data of the woaded a-assets of a-a given type
  • State<T>: the cuwwent vawue of a states type
  • NextState<T>: used to queue a twansition to anothew state
  • Gamepads: twacks the ids fow aww cuwwentwy-detected (connected) g-gamepad devices
  • SceneSpawner: diwect contwow ovew spawning scenes i-into the main a-app wowwd
  • FrameCount: the totaw nyumbew of fwames
  • ScreenshotManager: used to wequest a scweenshot of a w-window to be taken/saved
  • AppTypeRegistry: access to the wefwection type wegistwy
  • AsyncComputeTaskPool: task poow fow wunning backgwound c-cpu tasks
  • ComputeTaskPool: task poow whewe the main app scheduwe (aww t-the systems) w-wuns
  • IoTaskPool: task poow whewe backgwound i/o tasks w-wun (wike asset w-woading)
  • WinitWindows (non-send): waw state of the winit backend fow each window
  • NonSendMarker: dummy wesouwce to ensuwe a system a-awways wuns on t-the main thwead

wendew wowwd wesouwces

these wesouwces awe pwesent in the wendew wowwd. XD they can be accessed fwom wendewing systems (that wun d-duwing wendew stages).

  • MainWorld: (extwact scheduwe onwy!) access data f-fwom the main w-wowwd
  • RenderGraph: the bevy wendew gwaph
  • PipelineCache: bevy's managew of wendew pipewines. 🥺 u-used to stowe w-wendew pipewines u-used by the app, òωó t-to avoid wecweating them mowe than once.
  • TextureCache: bevy's managew of tempowawy textuwes. OwO u-usefuw when y-you nyeed textuwes t-to use intewnawwy duwing wendewing.
  • DrawFunctions<P>: stowes dwaw functions fow a given p-phase item type
  • RenderAssets<T>: contains handwes to the gpu wepwesentations o-of cuwwentwy w-woaded asset d-data
  • DefaultImageSampler: the defauwt sampwew fow Image asset textuwes
  • FallbackImage: dummy 1x1 pixew white textuwe. 🥺 usefuw f-fow shadews t-that nyowmawwy n-need a textuwe, òωó w-when you don't have one avaiwabwe.

thewe awe many othew wesouwces in t-the wendew wowwd, OwO w-which awe nyot m-mentioned hewe, OwO eithew because they awe intewnaw t-to bevy's w-wendewing awgowithms, 🥺 o-ow because they awe just extwacted copies o-of the equivawent w-wesouwces i-in the main wowwd.

wow-wevew wgpu wesouwces

using these wesouwces, ^•ﻌ•^ you can have d-diwect access t-to the wgpu apis fow contwowwing the gpu. these awe avaiwabwe in both the main w-wowwd and the w-wendew wowwd.

  • RenderDevice: the gpu device, ^•ﻌ•^ used fow cweating h-hawdwawe wesouwces f-fow wendewing/compute
  • [RenderQueue][bevy::wendewqueue]: the gpu queue fow submitting wowk t-to the hawdwawe
  • RenderAdapter: handwe to the physicaw gpu hawdwawe
  • RenderAdapterInfo: infowmation about the gpu hawdwawe t-that bevy is wunning o-on

input handwing wesouwces

these wesouwces wepwesent the cuwwent s-state of diffewent i-input devices. 🥺 w-wead them f-fwom youw systems to handwe usew input.

events

(mowe info about wowking with events)

input events

these events fiwe on activity with input devices. (ꈍᴗꈍ) w-wead them to [handwe usew input][cb::input].

  • MouseButtonInput: changes in the state of mouse buttons
  • MouseWheel: scwowwing by a nyumbew of pixews o-ow wines (MouseScrollUnit)
  • MouseMotion: wewative movement of the mouse (pixews f-fwom pwevious f-fwame), wegawdwess o-of the os p-pointew/cuwsow
  • CursorMoved: new position of the os mouse pointew/cuwsow
  • KeyboardInput: changes in the state of keyboawd k-keys (keypwesses, ^•ﻌ•^ n-nyot text)
  • ReceivedCharacter: unicode text input fwom the os (cowwect h-handwing o-of the usew's wanguage a-and wayout)
  • Ime: unicode text input fwom ime (suppowt f-fow advanced t-text input in diffewent s-scwipts)
  • TouchInput: change in the state of a fingew touching t-the touchscween
  • GamepadEvent: changes in the state of a gamepad o-ow any of its buttons o-ow axes
  • GamepadRumbleRequest: send these events to contwow gamepad w-wumbwe
  • TouchpadMagnify: pinch-to-zoom gestuwe on waptop touchpad (macos)
  • TouchpadRotate: two-fingew wotate gestuwe on waptop t-touchpad (macos)

engine events

events wewated to vawious intewnaw things h-happening duwing t-the nowmaw wuntime of a bevy app.

system and contwow events

events fwom the os / windowing system, ^•ﻌ•^ o-ow to contwow b-bevy.

components

the compwete wist of individuaw component t-types is t-too specific to b-be usefuw to wist h-hewe.

see: (wist in api docs)