Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Migration to bevy_ecs_tiled v0.10

This guide outlines the steps required to migrate your project to version 0.10 of bevy_ecs_tiled.

Main Changes

  • Bevy v0.17 Support: bevy_ecs_tiled now works seamlessly with Bevy v0.17, allowing you to take advantage of the latest engine features and performance improvements. See the Bevy 0.17 release notes for details.

  • Enhanced ColliderCreated Event: The ColliderCreated event now includes a direct reference to the collider's parent entity, making it easier to attach additional physics components or interact with spawned colliders. The event previously only contained a TiledColliderOrigin, which has been renamed to TiledColliderSource.

  • External Type Re-exports: Types from external crates (such as rs-tiled, geo, and regex) are now re-exported through dedicated modules. This avoids name clashes and makes type usage explicit.

Migration Steps

  1. Update Dependencies in Cargo.toml:

    bevy = "0.17"
    bevy_ecs_tiled = "0.10"
    

    Note: You may also need to update other Bevy-related crates to ensure compatibility.

  2. Review the Bevy Migration Guide: Follow Bevy's official migration steps to update your project for Bevy v0.17. This will help you resolve breaking changes and take advantage of new features.

  3. Update Usage of External Types:

    If your code uses types from rs-tiled, geo, or regex, you must now reference them via their dedicated modules. This ensures clarity and prevents naming conflicts.

    #![allow(unused)]
    fn main() {
    use bevy_ecs_tiled::prelude::*;
    // For external types, use their module:
    let tiled_id: tiled::TiledId = 10;
    }
  4. Update Usage of TiledEvent<ColliderCreated>:

    In previous versions, the event only provided a TiledColliderOrigin. In v0.10, this has been renamed to TiledColliderSource, and the event now also includes a reference to the collider's parent entity. This change makes it easier to interact with colliders and attach additional physics components directly after creation.

Resources