Class: RETMX::Map::ObjectGroup

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#heightObject (readonly)

The height of the object group in tiles. Meaningless



128
129
130
# File 'lib/retmx.rb', line 128

def height
  @height
end

#nameObject (readonly)

The name of the object group.



116
117
118
# File 'lib/retmx.rb', line 116

def name
  @name
end

#widthObject (readonly)

The width of the object group in tiles. Meaningless.



125
126
127
# File 'lib/retmx.rb', line 125

def width
  @width
end

#xObject (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

#yObject (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

#eachObject



138
139
140
# File 'lib/retmx.rb', line 138

def each
  @objects.each { |i| yield i}
end