Class: Metro::UI::TileMapOrthogonalLayer
- Defined in:
- lib/metro/models/ui/tile_map.rb
Constant Summary
Constants included from Metro::Units
Instance Attribute Summary
Attributes inherited from TileLayer
#layer, #map, #tilesets, #viewport
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from TileLayer
#build_tiles_index, #cached_images, #column, #data, #draw, #row, #tile_bounds, #tiles_within_viewport, #tileset_image, #x, #y, #z_order
Methods inherited from Model
#_load, #_save, #after_initialize, #bounds, #completed?, #create, #draw, hierarchy, inherited, #initialize, metro_name, #model, model_name, models, #name, #notification, #saveable_to_view, #show, #to_hash, #update
Methods included from HasEvents
Methods included from KeyValueCoding
Methods included from PropertyOwner
Constructor Details
This class inherits a constructor from Metro::Model
Instance Method Details
#position_of_image(image, row, column) ⇒ Object
77 78 79 80 81 |
# File 'lib/metro/models/ui/tile_map.rb', line 77 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 Bounds.new left: pos_x, top: pos_y, right: pos_x + map.tilewidth, bottom: pos_y + map.tileheight/2 end |