Skip to content

Commit

Permalink
Use Tiled Y-axis for Layer#tile_at
Browse files Browse the repository at this point in the history
reverts da5fdfb
  • Loading branch information
vinnydiehl authored and wildfiler committed May 4, 2023
1 parent 5c19d6a commit d99f7f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tiled/layer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def tiles
end
end

# Get tile by x, y coordinates (0, 0 is based on tile render order)
# Get tile by x, y coordinates
# @return [Tiled::Tile, nil] tile at x, y coordinate on this layer or `nil`
def tile_at(x, y)
tiles[render_order == RIGHT_DOWN ? y : map.attributes.height - 1 - y][x]
tiles[y][x]
end

# Method to get array of visible and renderable sprites from layer.
Expand Down

0 comments on commit d99f7f8

Please sign in to comment.