Trouv / bevy_ecs_ldtk

ECS-friendly ldtk plugin for bevy, leveraging bevy_ecs_tilemap
Other
662 stars 74 forks source link

Built-in conforming to screen size? #120

Open naiveai opened 1 year ago

naiveai commented 1 year ago

I see that the platformer example you have uses a system called camera_fit_inside_current_level which changes the size of the camera to keep a certain aspect ratio as the window resizes. Its presence ended up confusing me since I was comparing my level which wasn't resizing like the platformer example was and had to dig into the code to find out that it's not in fact default behaviour. Is it possible to include this by default (or as a setting) in bevy_ecs_ldtk? I'm not fully aware of technical limitations that may prevent that, but even if that's the case, it would be useful to place a tutorial for reference in case someone else runs into this issue.

I'd be happy to submit a PR for either of these, I'd just like to clarify which would be the better solution.

Trouv commented 1 year ago

This plugin is a bit long-to-compile and opinionated already, so I think it would be best to leave camera logic up to the user. But yeah, many aspects of the platformer example could probably be better-explained and more visible. It could use some cleaning up and re-organizing, and it may be good to make that system more visible by referencing it in the example's docs, or putting it in its own camera.rs module. It would probably also be good to have a different example with the opposite behavior - fitting the camera around the level, so the entire level is always visible. Good for puzzle games.