Skip to content
Merged
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
28 changes: 22 additions & 6 deletions arcade/tilemap/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import os
from collections import OrderedDict
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING, Union, cast
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast

import pytiled_parser
import pytiled_parser.tiled_object
Expand All @@ -30,10 +30,11 @@
if TYPE_CHECKING:
from arcade import TextureAtlas

from arcade.types import Point, TiledObject
from pyglet.math import Vec2

from arcade.geometry_generic import rotate_point
from arcade.resources import resolve_resource_path
from pyglet.math import Vec2
from arcade.types import Point, TiledObject

_FLIPPED_HORIZONTALLY_FLAG = 0x80000000
_FLIPPED_VERTICALLY_FLAG = 0x40000000
Expand Down Expand Up @@ -442,7 +443,14 @@ def _create_sprite_from_tile(

# Can image_file be None?
image_x, image_y, width, height = _get_image_info_from_tileset(tile)
texture = load_texture(image_file, x=image_x, y=image_y, width=width, height=height) # type: ignore
texture = load_texture(
image_file, # type: ignore
x=image_x,
y=image_y,
width=width,
height=height,
hit_box_algorithm=hit_box_algorithm
)
if tile.flipped_diagonally:
texture = texture.flip_diagonally()
if tile.flipped_horizontally:
Expand Down Expand Up @@ -569,7 +577,10 @@ def _create_sprite_from_tile(
image_file = _get_image_source(frame_tile, map_directory)

if not frame_tile.tileset.image and image_file:
texture = load_texture(image_file)
texture = load_texture(
image_file,
hit_box_algorithm=hit_box_algorithm
)
elif image_file:
# No image for tile, pull from tilesheet
(
Expand All @@ -580,7 +591,12 @@ def _create_sprite_from_tile(
) = _get_image_info_from_tileset(frame_tile)

texture = load_texture(
image_file, x=image_x, y=image_y, width=width, height=height
image_file,
x=image_x,
y=image_y,
width=width,
height=height,
hit_box_algorithm=hit_box_algorithm
)
else:
raise RuntimeError(
Expand Down