flame-engine / flame-engine/flame

Insert Object Between Tiled Layers using (Leap + Flame)

Open
#3,594 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
10.8k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
21

Description

### 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](https://github.com/user-attachments/assets/0e1819f0-99ed-44e6-85f7-d590e65106fd)

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

344*40 Map size Tiled
22016*2560 Dimension Figma Size
Orthogonal
Right Down

64*64 Tile && Grid Size

Flutter Anchor camera.viewfinder.zoom = 0.31;

Player:--128*128
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

- [x] Are you interested in working on a PR for this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.