Class: Dedalus::Elements::Icon
- Inherits:
-
Image
- Object
- Dedalus::Element
- Atom
- Image
- Dedalus::Elements::Icon
- Defined in:
- lib/dedalus/elements/icon.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Image
#invert_x, #invert_y, #overlay_color, #padding, #z_order
Attributes inherited from Atom
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 Image
#asset, description, #dimensions, #height, #offset, #overlay_gosu_color, #render, #width
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
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/dedalus/elements/icon.rb', line 4 def name @name end |
Class Method Details
.example_data ⇒ Object
14 15 16 |
# File 'lib/dedalus/elements/icon.rb', line 14 def self.example_data { name: 'house' } end |
.for(sym, attrs = {}) ⇒ Object
19 20 21 |
# File 'lib/dedalus/elements/icon.rb', line 19 def for(sym, attrs={}) new(attrs.merge(name: sym)) end |
Instance Method Details
#path ⇒ Object
10 11 12 |
# File 'lib/dedalus/elements/icon.rb', line 10 def path @path ||= "media/icons/#{name}.png" end |
#scale ⇒ Object
6 7 8 |
# File 'lib/dedalus/elements/icon.rb', line 6 def scale @scale ||= 0.062 end |