Class: Tmx::Map
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Tmx::Map
- Defined in:
- lib/tmx/map.rb
Instance Method Summary collapse
- #image_layers ⇒ Object
- #layers ⇒ Object
- #object_groups ⇒ Object
-
#objects ⇒ Objects
An array-like object of all the objects within the map.
- #tilesets ⇒ Object
Instance Method Details
#image_layers ⇒ Object
28 29 30 |
# File 'lib/tmx/map.rb', line 28 def image_layers @object_groups ||= Array(contents['image_layers']).map {|layer| ImageLayer.new layer.merge(contents: layer) } end |
#layers ⇒ Object
11 12 13 |
# File 'lib/tmx/map.rb', line 11 def layers @layers ||= Array(contents['layers']).map {|layer| Layer.new layer.merge(contents: layer) } end |
#object_groups ⇒ Object
19 20 21 |
# File 'lib/tmx/map.rb', line 19 def object_groups @object_groups ||= Array(contents['object_groups']).map {|group| ObjectGroup.new group.merge(contents: group) } end |