Class: Gosu::Tiled::Layers
- Inherits:
-
Object
- Object
- Gosu::Tiled::Layers
- Includes:
- Enumerable
- Defined in:
- lib/gosu_tiled/layers.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(window, data, options) ⇒ Layers
constructor
A new instance of Layers.
- #object ⇒ Object
- #size ⇒ Object
- #tile ⇒ Object
Constructor Details
Instance Method Details
#each(&block) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/gosu_tiled/layers.rb', line 24 def each(&block) @layers.each do |layer| if block_given? block.call(layer) else yield layer end end end |
#object ⇒ Object
16 17 18 |
# File 'lib/gosu_tiled/layers.rb', line 16 def object @layers.select { |l| l.type == 'objectgroup' }.select(&:visible?) end |
#size ⇒ Object
20 21 22 |
# File 'lib/gosu_tiled/layers.rb', line 20 def size @layers.size end |
#tile ⇒ Object
12 13 14 |
# File 'lib/gosu_tiled/layers.rb', line 12 def tile @layers.select { |l| l.type == 'tilelayer' }.select(&:visible?) end |