Class: Metro::UI::TileMapOrthogonalLayer

Inherits:
TileLayer show all
Defined in:
lib/metro/models/ui/tile_map.rb

Constant Summary

Constants included from Metro::Units

Metro::Units::Bounds

Instance Attribute Summary

Attributes inherited from TileLayer

#layer, #map, #tilesets, #viewport

Attributes inherited from Model

#scene, #window

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

included

Methods included from KeyValueCoding

#get, #set

Methods included from PropertyOwner

included, #properties

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