levigilbert / godot-LDtk-import

Basic GDscript for importing LDtk files into the Godot game engine.
MIT License
130 stars 15 forks source link

Added ability to add light occluder #13

Closed DavidMag closed 3 years ago

DavidMag commented 3 years ago

Ability to automatically create light occluder in Godot by specifying some data as custom data on the tiles in LDtk.

If { "light_occluder": true } is attached it will create a simple square occluder filling the whole tile.

But you can also specify a custom shape to for example have rounded corners like this.

{
  "light_occluder_shape": [
    {"x": 64, "y": 15},
    {"x": 64, "y": 64},
    {"x": 0, "y": 64},
    {"x": 0, "y": 0},
    {"x": 48, "y": 0},
    {"x": 55, "y": 3.2},
    {"x": 60, "y": 8.8}
  ]
}
image
DavidMag commented 3 years ago

@lrgilbert Can't seem to add you as a reviewer but what do you think about this?

levigilbert commented 3 years ago

Hey, sorry about that, been busy. I’ll take a look at everything tonight and let you know. Thank you!

levigilbert commented 3 years ago

Looks good, Thank you for the PR!

DavidMag commented 3 years ago

@lrgilbert Thanks! Also I've some thoughts about other improvements/reworks for the importer. If you're interested is there some place to get in contact with you? Discord, twitter, Instagram whatever 😄