Skip to content

Insert Object Between Tiled Layers using (Leap + Flame) #3594

@woxxin20

Description

@woxxin20

What could be improved

i have map animated.tmx in my asset that i created with Tiled software,

🧭 Context and Goal
I'm building a game using Flame (v1.11.0) with the Leap platformer library, leveraging .tmx maps and object layers for level content.

My goal is to insert animated objects (custom Flame components) — such as cow_zone areas — between specific Tiled map layers during gameplay. These animated tiles are parsed from ObjectGroup layers and drawn using custom PositionComponents (e.g., UniversalAnimationLayer), each with an assigned priority.

Flutter: 3.29.3
Dart : 3.7.2
Flame: 1.19.0

Below is GIF From TIled(that view want)
https://github.com/user-attachments/assets/5558bd9e-d1ce-410e-b2f7-f5ad3daa1e1e

this is the problems (that i got)
Image

Leap: https://github.com/VeryGoodOpenSource/leap.git
flame_tiled: https://github.com/flame-engine/flame.git
flame_behaviors: ^1.0.0

tiled map details:-----
tiled Software V:--1.10.2

Tiled Map Properties:--

tileset atlas :-- 4048*4048

34440 Map size Tiled
22016
2560 Dimension Figma Size
Orthogonal
Right Down

64*64 Tile && Grid Size

Flutter Anchor camera.viewfinder.zoom = 0.31;

Player:--128128
Iteam:--75
75
enemy:--128*128

Layer Format:--

respawn -Object
spawn -Object
enemies -Object
items -Object
windMill_zone -Object
fishhouse_zone -Object
treehouse_back -Layer
Ground -Layer
water/spikes -Layer
treehouse_front -Layer
house_zone -Object
cow zone -Object
wateffall_zone -Object
tree_zone -Object
fabulous_zone -Object
decorations_terrain -Layer
decorations -Layer
coconut zone -Object

❗️The Core Problem
Leap loads and draws all Tiled map layers as a single internal structure, making it impossible to inject custom Components (like animations) between Tiled layers.

Even though I:

Gave negative or mid-range priority values (priority: -1000, priority: 250, etc.)

Used UniversalAnimationLayer as a PositionComponent

Parsed ObjectGroups from .tmx files and spawned Flame animation components correctly

…the result is:

Custom objects always render either completely behind or completely in front of all tile layers.

There’s no access to control per-layer draw order or inject content between tile layers.

⚠️⚠️Recap:-
Object render between 2 layer (priority not work) @erickzanardo @spydon @kurtome

Why should this be improved

To add animated object between layer

Risks

No response

More information

No response

Other

  • Are you interested in working on a PR for this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions