Class: Tmxed::TileSet

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#windowObject

Returns the value of attribute window.



3
4
5
# File 'lib/tmxed_ext/tile_set.rb', line 3

def window
  @window
end

Instance Method Details

#crop_boundsObject



13
14
15
# File 'lib/tmxed_ext/tile_set.rb', line 13

def crop_bounds
  [ margin, margin, tilewidth - spacing, tileheight - spacing ]
end

#full_heightObject



9
10
11
# File 'lib/tmxed_ext/tile_set.rb', line 9

def full_height
  tileheight + spacing
end

#full_widthObject



5
6
7
# File 'lib/tmxed_ext/tile_set.rb', line 5

def full_width
  tilewidth + spacing
end

#image_pathObject



17
18
19
# File 'lib/tmxed_ext/tile_set.rb', line 17

def image_path
  Metro::AssetPath.with(image).filepath
end

#imagesObject



21
22
23
24
25
26
# File 'lib/tmxed_ext/tile_set.rb', line 21

def images
  @images ||= begin
    original_images = Gosu::Image.load_tiles window, image_path, full_width,full_height, true
    crop_images original_images
  end
end