Skip to content

Commit 26bf7ee

Browse files
authored
Update tilemap to respect object visibility settings (#2829)
1 parent f8d139b commit 26bf7ee

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
You can grab pre-release versions from PyPi. See the available versions from the
44
Arcade [PyPi Release History](https://pypi.org/project/arcade/#history) page.
55

6+
## Unreleased
7+
8+
### Breaking Change
9+
- Tilemap: Sprites of an object tile layer will now apply visibility of the object.
10+
611
## 4.0.0.dev3
712

813
### Fixes

arcade/resources/assets/tiled_maps/test_objects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"name":"crate1",
172172
"rotation":-45,
173173
"type":"crate",
174-
"visible":true,
174+
"visible":false,
175175
"width":400,
176176
"x":1500,
177177
"y":1800

arcade/tilemap/tilemap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ def _process_object_layer(
896896

897897
my_sprite.position = (x + rotated_center_x, y + rotated_center_y)
898898
my_sprite.angle = angle_degrees
899+
my_sprite.visible = cur_object.visible
899900

900901
if layer.tint_color:
901902
my_sprite.color = ArcadeColor.from_iterable(layer.tint_color)

tests/unit/tilemap/test_tilemap_objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ def test_one():
2323
sprite_1 = tile_list[0]
2424
assert sprite_1 is not None
2525
#
26-
# Test width, height and angle
26+
# Test width, height, angle and visibility
2727
#
2828
assert sprite_1.width == 400
2929
assert sprite_1.height == 1000
3030
assert sprite_1.angle == -45
31+
assert sprite_1.visible == False
3132

3233
#
3334
# Test type and name properties

0 commit comments

Comments
 (0)