Class: TilesetTooling::Data::Tile

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/tileset_tooling/data/tile.rb

Overview

Class representing a TileSet’s information

Instance Method Summary collapse

Instance Method Details

#bottomObject

Helper to get the bottom coordinate



22
23
24
# File 'lib/tileset_tooling/data/tile.rb', line 22

def bottom
  top + height
end

#rightObject

Helper to get the right coordinate



27
28
29
# File 'lib/tileset_tooling/data/tile.rb', line 27

def right
  left + width
end

#to_sObject

Helper to print the information of the tile



17
18
19
# File 'lib/tileset_tooling/data/tile.rb', line 17

def to_s
  "#{top},#{left} [#{margin_top},#{margin_left},#{margin_bottom},#{margin_right}]"
end