Class: RETMX::Map::ObjectGroup
- Inherits:
-
Object
- Object
- RETMX::Map::ObjectGroup
- Includes:
- Enumerable
- Defined in:
- lib/retmx.rb
Overview
The object group is in fact a map layer, and is hence called “object layer” in Tiled Qt.
Defined Under Namespace
Classes: Object
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
The height of the object group in tiles.
-
#name ⇒ Object
readonly
The name of the object group.
-
#width ⇒ Object
readonly
The width of the object group in tiles.
-
#x ⇒ Object
readonly
The x coordinate of the object group in tiles.
-
#y ⇒ Object
readonly
The y coordinate of the object group in tiles.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(map, xml) ⇒ ObjectGroup
constructor
A new instance of ObjectGroup.
Constructor Details
#initialize(map, xml) ⇒ ObjectGroup
Returns a new instance of ObjectGroup.
131 132 133 134 135 |
# File 'lib/retmx.rb', line 131 def initialize(map, xml) @map = map @objects = [] build(xml) end |
Instance Attribute Details
#height ⇒ Object (readonly)
The height of the object group in tiles. Meaningless
128 129 130 |
# File 'lib/retmx.rb', line 128 def height @height end |
#name ⇒ Object (readonly)
The name of the object group.
116 117 118 |
# File 'lib/retmx.rb', line 116 def name @name end |
#width ⇒ Object (readonly)
The width of the object group in tiles. Meaningless.
125 126 127 |
# File 'lib/retmx.rb', line 125 def width @width end |
#x ⇒ Object (readonly)
The x coordinate of the object group in tiles. Defaults to 0 and can no longer be changed in Tiled Qt.
119 120 121 |
# File 'lib/retmx.rb', line 119 def x @x end |
#y ⇒ Object (readonly)
The y coordinate of the object group in tiles. Defaults to 0 and can no longer be changed in Tiled Qt.
122 123 124 |
# File 'lib/retmx.rb', line 122 def y @y end |
Instance Method Details
#each ⇒ Object
138 139 140 |
# File 'lib/retmx.rb', line 138 def each @objects.each { |i| yield i} end |