Class: AnimateIt::FrameContext
- Inherits:
-
Data
- Object
- Data
- AnimateIt::FrameContext
- Defined in:
- lib/animate_it/frame_context.rb
Instance Attribute Summary collapse
-
#composition ⇒ Object
readonly
Returns the value of attribute composition.
-
#duration_in_frames ⇒ Object
readonly
Returns the value of attribute duration_in_frames.
-
#fps ⇒ Object
readonly
Returns the value of attribute fps.
-
#frame ⇒ Object
readonly
Returns the value of attribute frame.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#local_frame ⇒ Object
readonly
Returns the value of attribute local_frame.
-
#props ⇒ Object
readonly
Returns the value of attribute props.
-
#segment ⇒ Object
readonly
Returns the value of attribute segment.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #interpolate(input, input_range, output_range) ⇒ Object
- #progress(duration_frames: nil) ⇒ Object
- #spring ⇒ Object
Instance Attribute Details
#composition ⇒ Object (readonly)
Returns the value of attribute composition
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def composition @composition end |
#duration_in_frames ⇒ Object (readonly)
Returns the value of attribute duration_in_frames
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def duration_in_frames @duration_in_frames end |
#fps ⇒ Object (readonly)
Returns the value of attribute fps
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def fps @fps end |
#frame ⇒ Object (readonly)
Returns the value of attribute frame
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def frame @frame end |
#height ⇒ Object (readonly)
Returns the value of attribute height
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def height @height end |
#local_frame ⇒ Object (readonly)
Returns the value of attribute local_frame
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def local_frame @local_frame end |
#props ⇒ Object (readonly)
Returns the value of attribute props
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def props @props end |
#segment ⇒ Object (readonly)
Returns the value of attribute segment
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def segment @segment end |
#width ⇒ Object (readonly)
Returns the value of attribute width
2 3 4 |
# File 'lib/animate_it/frame_context.rb', line 2 def width @width end |
Instance Method Details
#interpolate(input, input_range, output_range) ⇒ Object
20 21 22 |
# File 'lib/animate_it/frame_context.rb', line 20 def interpolate(input, input_range, output_range, **) Timing.interpolate(input, input_range, output_range, **) end |
#progress(duration_frames: nil) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/animate_it/frame_context.rb', line 13 def progress(duration_frames: nil) total = duration_frames || segment&.duration_frames || duration_in_frames return 0.0 if total.to_i <= 1 local_frame.to_f / (total - 1) end |