-
Notifications
You must be signed in to change notification settings - Fork 380
[Merged by Bors] - 0.7 migration guide #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
536494c
86622b7
f7a0e6d
90481ec
273b170
0448fea
68a0799
7fc68ed
41f9408
5c296b9
b4a446a
9615fde
cbc1bb5
ffb87f6
492ba58
216542e
c55512e
45b400d
648dc1f
318c433
23e0cea
4156ee3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
+++ | ||
title = "0.6 to 0.7" | ||
weight = 1 | ||
sort_by = "weight" | ||
template = "book-section.html" | ||
page_template = "book-section.html" | ||
insert_anchor_links = "right" | ||
[extra] | ||
long_title = "Migration Guide: 0.6 to 0.7" | ||
+++ | ||
|
||
<!-- Github filter used to find the relevant PRs "is:pr label:C-Breaking-Change closed:>2022-02-01 [Merged by Bors]" --> | ||
|
||
### AliasedMutability | ||
|
||
<https://github.com/bevyengine/bevy/pull/4298> | ||
|
||
The QueryEntityError enum now has a `AliasedMutability` variant, and returns the offending entity | ||
|
||
### Remove margins.rs | ||
|
||
<https://github.com/bevyengine/bevy/pull/4284> | ||
|
||
The Margins type got removed. To migrate you just have to change every occurrence of Margins to UiRect. | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Remove face_toward.rs | ||
|
||
<https://github.com/bevyengine/bevy/pull/4277> | ||
|
||
The FaceToward trait got removed. To migrate you just have to change every occurrence of Mat4::face_toward to Mat4::look_at_rh. | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### unsafeify World::entities_mut | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<https://github.com/bevyengine/bevy/pull/4093> | ||
|
||
```rs | ||
// 0.6 | ||
world.entities_mut() | ||
|
||
// 0.7 | ||
unsafe { world.entities_mut() } | ||
``` | ||
|
||
### Mesh vertex buffer layouts | ||
|
||
<https://github.com/bevyengine/bevy/pull/3959> | ||
|
||
TODO | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Remove the need for 'IntoSystem::into_system()' when using run criteria piping | ||
|
||
<https://github.com/bevyengine/bevy/pull/3923> | ||
|
||
```rs | ||
// 0.6 | ||
.with_run_criteria(RunCriteria::pipe( | ||
"is_done_label", | ||
IntoSystem::into_system(inverse), | ||
)) | ||
|
||
// 0.7 | ||
.with_run_criteria(RunCriteria::pipe("is_done_label", inverse)) | ||
``` | ||
|
||
### Obviate the need for RunSystem, and remove it | ||
|
||
<https://github.com/bevyengine/bevy/pull/3817> | ||
|
||
TODO | ||
|
||
### Replace VSync with PresentMode | ||
|
||
https://github.com/bevyengine/bevy/pull/3812 | ||
|
||
Instead of using a boolean flag for vsync we switched to using a {{rust_type(type="struct" crate="bevy" mod="window" version="0.7.0" name="PresentMode" no_mod=true)}} enum with multiple variants. | ||
|
||
```rs | ||
// 0.6 | ||
App::new() | ||
.insert_resource(WindowDescriptor { | ||
vsync: false, | ||
..Default::default() | ||
}) | ||
|
||
// 0.7 | ||
App::new() | ||
.insert_resource(WindowDescriptor { | ||
present_mode: PresentMode::Mailbox, | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
..Default::default() | ||
}) | ||
``` | ||
|
||
### Fix mul_vec3 tranformation order | ||
|
||
<https://github.com/bevyengine/bevy/pull/3811> | ||
|
||
Fixes order of transformations to scale -> rotate -> translate. This doesn't require any code changes, but it means SpriteBundle will behave as expected when rotating. | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Use marker components for cameras instead of name strings | ||
|
||
<https://github.com/bevyengine/bevy/pull/3635> | ||
|
||
TODO | ||
|
||
### Remove the config api | ||
|
||
<https://github.com/bevyengine/bevy/pull/3633> | ||
|
||
TODO | ||
|
||
### Add capability to render to a texture | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<https://github.com/bevyengine/bevy/pull/3412> | ||
|
||
```rs | ||
// 0.6 | ||
commands.spawn_bundle(PerspectiveCameraBundle { | ||
camera: Camera { | ||
window: window_id, | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}); | ||
|
||
// 0.7 | ||
commands.spawn_bundle(PerspectiveCameraBundle { | ||
camera: Camera { | ||
target: RenderTarget::Window(window_id), | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}); | ||
``` | ||
|
||
### Implement init_resource for Commands and World | ||
|
||
<https://github.com/bevyengine/bevy/pull/3079> | ||
|
||
```rs | ||
#[derive(Default)] | ||
struct Scoreboard { | ||
current_score: u32, | ||
high_score: u32, | ||
} | ||
|
||
// 0.6 | ||
commands.insert_resource(Scoreboard::Default()); | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// 0.7 | ||
commands.init_resource::<Scoreboard>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't the 0.6 and the 0.7 examples here have different behaviour in case there is already a scoreboard resource? Maybe we should just say this is new functionality on Commands, so no 0.6 example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it's a migration guide, if it's purely new then it doesn't need any migration. I just did that after a quick glance at the PR. I wasn't sure what the change was. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. |
||
``` | ||
|
||
### ParamSet for conflicting SystemParam | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<https://github.com/bevyengine/bevy/pull/2765> | ||
|
||
TODO | ||
IceSentry marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.