Skip to content

Commit

Permalink
Merge pull request #86 from bytestring-net/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
IDEDARY authored Jan 25, 2025
2 parents 37d0998 + bedf0fa commit 1232be4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .vscode/keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
{
"key": "f5",
"command": "workbench.action.tasks.runTask",
"args": "rust: cargo run 1",
"args": "Run 1",
"when": "editorLangId == 'rust'"
},
{
"key": "f6",
"command": "workbench.action.tasks.runTask",
"args": "rust: cargo run 2",
"args": "Run 2",
"when": "editorLangId == 'rust'"
},
{
"key": "f7",
"command": "workbench.action.tasks.runTask",
"args": "rust: cargo run 3",
"args": "Run 3",
"when": "editorLangId == 'rust'"
}
]
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"$rustc"
],
"group": "build",
"label": "rust: cargo run 1"
"label": "Run 1"
},
{
"type": "cargo",
Expand All @@ -19,7 +19,7 @@
"$rustc"
],
"group": "build",
"label": "rust: cargo run 2"
"label": "Run 2"
},
{
"type": "cargo",
Expand All @@ -29,7 +29,7 @@
"$rustc"
],
"group": "build",
"label": "rust: cargo run 3"
"label": "Run 3"
}
]
}
6 changes: 3 additions & 3 deletions docs/src/advanced/worldspace_ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ For 3D images, you can take a look at this example: [worldspace example](https:/

### Text

3D text is currently limited and you have to use a 3rd party crate `bevy_mod_billboard`. You can take a look at how integrate it here: [worldspace text example](https://github.com/bytestring-net/bevy_lunex/tree/main/examples/worldspace_text)
3D text is currently limited and you have to use a 3rd party crate `bevy_mod_billboard`. You can take a look at how to integrate it here: [worldspace text example](https://github.com/bytestring-net/bevy_lunex/tree/main/examples/worldspace_text)

### Important

When we are spawning a 3D hologram, we don't want the size to be the size of our camera, but some custom fixed size.
You can achieve that by specifying the size in the `Dimension` component on `UiTreeBundle` when we are spawning our tree.
If you don't do that, your UI size will default to 0 and you won't see anything if you use `Rl` units.

Another fact to consider is `abs_scale`. If you use `UiTree::new2d`, then the abs_scale is 1. But if you use `UiTree::new3d` then the abs_scale becoms `0.001`. This is to create a sensible balance between sizes when going from 2d to 3d.
Another thing to keep in mind is the difference in `abs_scale`. If you use `UiTree::new2d`, then the abs_scale is set to `1`. But if you use `UiTree::new3d` then the abs_scale is set to `0.001`. This is to create a sensible balance between sizes when going from 2d to 3d.

Reason for that is, that in 2D Bevy, `1.0` in `Transform` corresponds to 1 pixel on screen. But in 3D Bevy, `1.0` means `1 meter`. You can now see the problem. To make things easier to use, I decided that when you are working with 3D UI in Lunex, all `Ab` units are in **`centimeters`**.
Because in 2D Bevy, `1.0` in `Transform` corresponds to 1 pixel on screen. But in 3D Bevy, `1.0` means `1 meter`. You can now see the problem. To make things easier to use, I decided that when you are working with 3D UI in Lunex, all `Ab` units are in **`centimeters`**.

0 comments on commit 1232be4

Please sign in to comment.