Class: Dedalus::Elements::Sprite
- Inherits:
-
Image
- Object
- Dedalus::Element
- Atom
- Image
- Dedalus::Elements::Sprite
- Defined in:
- lib/dedalus/elements/sprite.rb
Instance Attribute Summary collapse
-
#frame ⇒ Object
Returns the value of attribute frame.
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from Image
#invert_x, #invert_y, #overlay_color, #padding, #path, #z_order
Attributes inherited from Atom
Attributes inherited from Dedalus::Element
#background_color, #color, #height_percent, #margin, #padding, #position, #width_percent
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Image
#dimensions, #offset, #overlay_gosu_color, #render, #scale
Methods inherited from Dedalus::Element
#big_font, #code_font, #draw_bounding_box, #font, #huge_font, #initialize, #tiny_font, #view, #window
Constructor Details
This class inherits a constructor from Dedalus::Element
Instance Attribute Details
#frame ⇒ Object
Returns the value of attribute frame.
4 5 6 |
# File 'lib/dedalus/elements/sprite.rb', line 4 def frame @frame end |
#height ⇒ Object
Returns the value of attribute height.
4 5 6 |
# File 'lib/dedalus/elements/sprite.rb', line 4 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
4 5 6 |
# File 'lib/dedalus/elements/sprite.rb', line 4 def width @width end |
Class Method Details
.description ⇒ Object
19 20 21 |
# File 'lib/dedalus/elements/sprite.rb', line 19 def self.description "an animated image" end |
.example_data ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/dedalus/elements/sprite.rb', line 10 def self.example_data { path: "media/images/tiles.png", frame: 3, width: 64, height: 64 } end |
Instance Method Details
#asset ⇒ Object
6 7 8 |
# File 'lib/dedalus/elements/sprite.rb', line 6 def asset @asset ||= Dedalus::ImageRepository.lookup_tiles(path, width, height)[frame] end |