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

add collision mask import property #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ are embedded, otherwise they will use the flags from their own import settings.
The collision layer for the maps and objects imported. If you need custom layers for
each object, consider using a post-import script.

### Collision Mask (Map only)

**Default: `1`**

The collision mask for the maps and objects imported. If you need custom masks for
each object, consider using a post-import script.

### Embed Internal Images

**Default: `Off`**
Expand Down
5 changes: 5 additions & 0 deletions addons/vnen.tiled_importer/tiled_import_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ func get_import_options(preset):
"default_value": 1,
"property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS
},
{
"name": "collision_mask",
"default_value": 1,
"property_hint": PROPERTY_HINT_LAYERS_2D_PHYSICS
},
{
"name": "embed_internal_images",
"default_value": true if preset == PRESET_PIXEL_ART else false
Expand Down
1 change: 1 addition & 0 deletions addons/vnen.tiled_importer/tiled_map_reader.gd
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func make_layer(layer, parent, root, data):
tilemap.cell_clip_uv = options.uv_clip
tilemap.cell_y_sort = true
tilemap.collision_layer = options.collision_layer
tilemap.collision_mask = options.collision_mask
tilemap.z_index = z_index

var offset = Vector2()
Expand Down