Class: RETMX::Map::TileSet::Image
- Inherits:
-
Object
- Object
- RETMX::Map::TileSet::Image
- Defined in:
- lib/retmx.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Height of image.
-
#source ⇒ Object
readonly
The reference to the tileset image file (Tiled supports most common image formats).
-
#trans ⇒ Object
readonly
Defines a specific color that is treated as transparent (example value: “FF00FF” for magenta).
-
#width ⇒ Object
readonly
Width of image.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Image
constructor
A new instance of Image.
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
#height ⇒ Object (readonly)
Height of image
479 480 481 |
# File 'lib/retmx.rb', line 479 def height @height end |
#source ⇒ Object (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 |
#trans ⇒ Object (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 |
#width ⇒ Object (readonly)
Width of image
476 477 478 |
# File 'lib/retmx.rb', line 476 def width @width end |