Class: RETMX::Map::TileSet::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/retmx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Image

Returns a new instance of Image.



481
482
483
484
485
486
487
# File 'lib/retmx.rb', line 481

def initialize(xml)
  doc = xml.elements['image']
  @source = doc.attributes['source']
  @trans = doc.attributes['trans']
  @width = doc.attributes['width'].to_i
  @height = doc.attributes['height'].to_i
end

Instance Attribute Details

#heightObject (readonly)

Height of image



479
480
481
# File 'lib/retmx.rb', line 479

def height
  @height
end

#sourceObject (readonly)

The reference to the tileset image file (Tiled supports most common image formats).



470
471
472
# File 'lib/retmx.rb', line 470

def source
  @source
end

#transObject (readonly)

Defines a specific color that is treated as transparent (example value: “FF00FF” for magenta).



473
474
475
# File 'lib/retmx.rb', line 473

def trans
  @trans
end

#widthObject (readonly)

Width of image



476
477
478
# File 'lib/retmx.rb', line 476

def width
  @width
end