Class: Three::AnimationAction
- Inherits:
-
Object
- Object
- Three::AnimationAction
- Defined in:
- lib/three/animation/animation_action.rb
Constant Summary collapse
- PROPERTY_NAMES =
{ enabled: "enabled", paused: "paused", time: "time", time_scale: "timeScale", weight: "weight", loop: "loop", repetitions: "repetitions", clamp_when_finished: "clampWhenFinished" }.freeze
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Instance Method Summary collapse
- #fade_in(duration) ⇒ Object
- #fade_out(duration) ⇒ Object
-
#initialize(handle, backend:) ⇒ AnimationAction
constructor
A new instance of AnimationAction.
- #play ⇒ Object
- #reset ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(handle, backend:) ⇒ AnimationAction
Returns a new instance of AnimationAction.
19 20 21 22 |
# File 'lib/three/animation/animation_action.rb', line 19 def initialize(handle, backend:) @handle = handle @backend = backend end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
16 17 18 |
# File 'lib/three/animation/animation_action.rb', line 16 def backend @backend end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
16 17 18 |
# File 'lib/three/animation/animation_action.rb', line 16 def handle @handle end |
Instance Method Details
#fade_in(duration) ⇒ Object
39 40 41 42 |
# File 'lib/three/animation/animation_action.rb', line 39 def fade_in(duration) @backend.fade_in_animation_action(@handle, duration) self end |
#fade_out(duration) ⇒ Object
44 45 46 47 |
# File 'lib/three/animation/animation_action.rb', line 44 def fade_out(duration) @backend.fade_out_animation_action(@handle, duration) self end |
#play ⇒ Object
24 25 26 27 |
# File 'lib/three/animation/animation_action.rb', line 24 def play @backend.play_animation_action(@handle) self end |
#reset ⇒ Object
34 35 36 37 |
# File 'lib/three/animation/animation_action.rb', line 34 def reset @backend.reset_animation_action(@handle) self end |
#stop ⇒ Object
29 30 31 32 |
# File 'lib/three/animation/animation_action.rb', line 29 def stop @backend.stop_animation_action(@handle) self end |