Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for procedural generation of a layer #30

Open
mufty opened this issue Oct 2, 2023 · 3 comments
Open

Support for procedural generation of a layer #30

mufty opened this issue Oct 2, 2023 · 3 comments

Comments

@mufty
Copy link

mufty commented Oct 2, 2023

Would like the option to be able to generate an intGrid layer while still using auto tiles and the setup from LDtk.

The way it works currently (at least from what I can see) is that the render function ignores whatever is currently stored in intGrid at the time of rendering and only renders the auto tiles.

It's missing a way to go through intGrid and create new auto tiles based on the rules set (kinda like it does when drawing by hand in LDtk). This doesn't have to happen on each render call but whenever intGrid changes if there would be an option to generate auto tiles out of it that would solve it. That way render function itself can still just render auto tiles like it is. And the user is able to create and remove tiles at runtime just by modifying the intGrid.

@mufty
Copy link
Author

mufty commented Oct 11, 2023

Got a very hacked up working version of this in my fork master...mufty:ldtk-haxe-api:master

I just copied stuff from LDtk sources into the API. Everything is in Layer which isn't good but It's cuz stuff like rules is just plain types as parsed from JSON so in order to clean it up I'd have to do instances for more objects than just Layer. I just wanted to see if it would work.

@mufty
Copy link
Author

mufty commented Oct 11, 2023

image

just for illustration I generated a new intgrid on runtime and then just call layer.applyAllAutoLayerRules() to get this sort of thing

@deepnight
Copy link
Owner

Related: deepnight/ldtk#970

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants