Class: Three::AnimationAction

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#backendObject (readonly)

Returns the value of attribute backend.



16
17
18
# File 'lib/three/animation/animation_action.rb', line 16

def backend
  @backend
end

#handleObject (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

#playObject



24
25
26
27
# File 'lib/three/animation/animation_action.rb', line 24

def play
  @backend.play_animation_action(@handle)
  self
end

#resetObject



34
35
36
37
# File 'lib/three/animation/animation_action.rb', line 34

def reset
  @backend.reset_animation_action(@handle)
  self
end

#stopObject



29
30
31
32
# File 'lib/three/animation/animation_action.rb', line 29

def stop
  @backend.stop_animation_action(@handle)
  self
end