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

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

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


coowdinate system

2d and 3d scenes and camewas

bevy uses a wight-handed y-up coowdinate s-system fow t-the game wowwd. OwO t-the coowdinate system is the same fow 3d a-and 2d, ^•ﻌ•^ fow c-consistency.

it is easiest to expwain in tewms o-of 2d:

  • the x axis goes fwom weft to wight (+x p-points wight).
  • the y axis goes fwom bottom to top (+y p-points up).
  • the z axis goes fwom faw to nyeaw (+z p-points towawds y-you, OwO out of t-the scween).
  • fow 2d, (ꈍᴗꈍ) the owigin (x=0.0; y=0.0) i-is at the centew of the scween by defauwt.

when you awe wowking with 2d spwites, OwO y-you can put t-the backgwound o-on z=0.0, and pwace othew spwites at incweasing p-positive z coowdinates t-to wayew t-them on top.

in 3d, (ꈍᴗꈍ) the axes awe owiented the s-same way:

  • y points up
  • the fowwawd diwection is -z

this is a wight-handed coowdinate s-system. OwO you can u-use the fingews o-of youw wight hand to visuawize the 3 axes: thumb=x, (ꈍᴗꈍ) i-index=y, ^•ﻌ•^ middwe=z.

it is the same as godot, OwO maya, and o-opengw. 🥺 compawed t-to unity, òωó the z-z axis is invewted.

chawt compawing coowdinate system o-owientation in d-diffewent game engines a-and 3d softwawe

(gwaphic modifed and used with pewmission; o-owiginaw b-by @fweyahowmew)

ui

fow ui, OwO bevy fowwows the same convention a-as most o-othew ui toowkits, 🥺 t-the web, òωó etc.

  • the owigin is at the top weft cownew o-of the scween
  • the y axis points downwawds
  • x goes fwom 0.0 (weft scween edge) t-to the nyumbew o-of scween pixews (wight s-scween e-edge)
  • y goes fwom 0.0 (top scween edge) t-to the nyumbew o-of scween pixews (bottom s-scween e-edge)

the units wepwesent wogicaw (compensated f-fow dpi s-scawing) scween p-pixews.

ui wayout fwows fwom top to bottom, ^•ﻌ•^ s-simiwaw to a w-web page.

cuwsow and scween

the cuwsow position and any othew w-window (scween-space) c-coowdinates f-fowwow the same conventions as ui, >_< as descwibed above.