Class: Dedalus::Elements::MapTile

Inherits:
Molecule show all
Defined in:
lib/dedalus/elements/map_tile.rb

Instance Attribute Summary collapse

Attributes inherited from Dedalus::Element

#background_color, #color, #height, #height_percent, #margin, #offset, #padding, #position, #shown, #width, #width_percent, #z_order

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Molecule

#click, #hover

Methods inherited from Dedalus::Element

#big_font, #code_font, #draw_bounding_box, #font, #huge_font, #initialize, #record?, #tiny_font, #view, #window

Constructor Details

This class inherits a constructor from Dedalus::Element

Instance Attribute Details

#asset_heightObject

Returns the value of attribute asset_height.



4
5
6
# File 'lib/dedalus/elements/map_tile.rb', line 4

def asset_height
  @asset_height
end

#asset_widthObject

Returns the value of attribute asset_width.



4
5
6
# File 'lib/dedalus/elements/map_tile.rb', line 4

def asset_width
  @asset_width
end

#frameObject

Returns the value of attribute frame.



4
5
6
# File 'lib/dedalus/elements/map_tile.rb', line 4

def frame
  @frame
end

#highlightObject

Returns the value of attribute highlight.



6
7
8
# File 'lib/dedalus/elements/map_tile.rb', line 6

def highlight
  @highlight
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/dedalus/elements/map_tile.rb', line 4

def path
  @path
end

#scaleObject

Returns the value of attribute scale.



4
5
6
# File 'lib/dedalus/elements/map_tile.rb', line 4

def scale
  @scale
end

Class Method Details

.descriptionObject



22
23
24
# File 'lib/dedalus/elements/map_tile.rb', line 22

def self.description
  'example of a custom tile class for image grid/sprite field'
end

.example_dataObject



26
27
28
# File 'lib/dedalus/elements/map_tile.rb', line 26

def self.example_data
  Sprite.example_data
end

Instance Method Details

#showObject



8
9
10
# File 'lib/dedalus/elements/map_tile.rb', line 8

def show
  tile_sprite
end

#tile_spriteObject



12
13
14
15
16
17
18
19
20
# File 'lib/dedalus/elements/map_tile.rb', line 12

def tile_sprite
  Sprite.new(
    frame: frame,
    asset_width: asset_width,
    asset_height: asset_height,
    path: path,
    scale: scale
  )
end