Skip to content

Commit

Permalink
doc: add migration guide from v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-bon committed Nov 15, 2024
1 parent ae6af39 commit c8ed403
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 7 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## [unreleased]

**BREAKING CHANGES**
This version brings breaking changes.
A [migration guide](https://adrien-bon.github.io/bevy_ecs_tiled/migrations/v0_5.html) is available to help adapt to these.

### Features

- Update to Bevy 0.15

### Changed

- Remove `map_initial_transform` and `map_initial_visibility` from `TiledMapSettings`, use required components instead

## v0.4.0

**BREAKING CHANGES**
Expand All @@ -10,7 +22,6 @@ A [migration guide](https://adrien-bon.github.io/bevy_ecs_tiled/migrations/v0_4.

### Features

- Update to Bevy 0.15
- Add map loading events to give user access to Tiled internal data structure.
- Add various settings to control where we spawn the map.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ You can browse the [examples](https://github.com/adrien-bon/bevy_ecs_tiled/tree/

|bevy|bevy_ecs_tilemap|bevy_ecs_tiled|
|---|---|---|
|0.15|0.15|0.4|
|0.14|0.14|0.3|
|0.15|0.15|0.5|
|0.14|0.14|0.3 - 0.4|
|0.13|main@e4f3cc6|branch 0.2|
|0.12|0.12|0.1|

Expand Down
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

# Migration guides

- [From v0.4.X to v0.5.X](migrations/v0_5.md)
- [From v0.3.X to v0.4.X](migrations/v0_4.md)

# Miscellaneous
Expand Down
7 changes: 3 additions & 4 deletions book/src/migrations/v0_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Overview

Version 0.4 was initially motivated by an update to the way we handle user properties.

It ended as a major overhaul of the plugin to provide a better API which gives more control to the user and update the crate for Bevy v0.15.
Version 0.4 was initially motivated by an update to the way we handle user properties but ended as a major overhaul of the plugin to provide a better API and to give more control to the user.

## Plugin instanciation

Expand Down Expand Up @@ -33,7 +31,8 @@ The plugin configuration is described in the [API reference](https://docs.rs/bev
The plugin entry point, ie. the `TiledMapBundle` bundle is gone.
It was cumbersome and did not allow for a proper separation of concerns (for instance, for physics).

Also, the `Handle<TiledMap>` type is not a Bevy component anymore, since Bevy `Handle<T>` now cannot derive the `Component` trait.
Also, the `Handle<TiledMap>` type is not a Bevy component anymore.
It was done in order to anticipate expected changes in Bevy where `Handle<T>` won't be able to derive the `Component` trait anymore.

Anyway, the new way to spawn a map is now easier: you just have to spawn a `TiledMapHandle` referencing your .TMX file asset:

Expand Down
44 changes: 44 additions & 0 deletions book/src/migrations/v0_5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# From v0.4.X to v0.5.X

## Overview

Version 0.5 updates the crate for Bevy v0.15.

It also takes advantages of the new `required_component` feature to simplify the crate API.

## Bevy v0.15 update

[Bevy official migration guide](https://bevyengine.org/learn/migration-guides/0-14-to-0-15/)

## Misc changes

### `TiledMapSettings` update

`map_initial_transform` and `map_initial_visibility` have been removed from `TiledMapSettings`.

If you want to tweak your map positioning or visibility, you should instead directly insert corresponding `Transform` or `Visibility` components on it.

Before:

```rust,no_run
let map_handle: Handle<TiledMap> = asset_server.load("map.tmx");
commands.spawn((
TiledMapHandle(map_handle),
TiledMapSettings {
map_initial_transform: Transform::from_xyz(150., 100., 0.),
map_initial_visibility: Visibility::Hidden,
..Default::default()
},
));
```

After:

```rust,no_run
let map_handle: Handle<TiledMap> = asset_server.load("map.tmx");
commands.spawn((
TiledMapHandle(map_handle),
Transform::from_xyz(150., 100., 0.),
Visibility::Hidden,
));
```

0 comments on commit c8ed403

Please sign in to comment.