Class: Castaway::Element::Still
- Defined in:
- lib/castaway/element/still.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Attributes inherited from Base
#attributes, #position, #production, #scene, #size
Instance Method Summary collapse
- #_prepare_canvas(_t, canvas) ⇒ Object
-
#initialize(production, scene, filename, full: false) ⇒ Still
constructor
A new instance of Still.
Methods inherited from Base
#_absolute, #_composite, #_convert, #_evaluate_animation_list, #_evaluate_attributes!, #_transform, #alive_at?, #animate, #at, #attribute, #duration, #effect, #enter, #exit, #gravity, #in, #out, #path, #render_at, #rotate, #scale, #t1, #t2, #tail
Constructor Details
#initialize(production, scene, filename, full: false) ⇒ Still
Returns a new instance of Still.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/castaway/element/still.rb', line 10 def initialize(production, scene, filename, full: false) super(production, scene) @filename = production.resource(filename) @info = MiniMagick::Image.new(@filename) @size = if full # scale to production resolution production.resolution else # use native image size Castaway::Size.new(@info.width, @info.height) end end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
8 9 10 |
# File 'lib/castaway/element/still.rb', line 8 def filename @filename end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
8 9 10 |
# File 'lib/castaway/element/still.rb', line 8 def info @info end |
Instance Method Details
#_prepare_canvas(_t, canvas) ⇒ Object
25 26 27 |
# File 'lib/castaway/element/still.rb', line 25 def _prepare_canvas(_t, canvas) canvas << @filename end |