Module: Metro::Tmx::TileLayer::OrthogonalPositioning

Defined in:
lib/metro/models/ui/tmx/orthogonal_position.rb

Instance Method Summary collapse

Instance Method Details

#position_of_image(image, row, column) ⇒ Object



6
7
8
9
10
# File 'lib/metro/models/ui/tmx/orthogonal_position.rb', line 6

def position_of_image(image,row,column)
  pos_x = x + column * map.tilewidth + map.tilewidth / 2
  pos_y = y + row * map.tileheight + map.tileheight / 2
  ::Metro::Units::RectangleBounds.new left: pos_x, top: pos_y, right: pos_x + map.tilewidth, bottom: pos_y + map.tileheight/2
end