./vdo_anim_object.lua

  1. -- Make sure vdo_base_object is loaded first! 
  2.  
  3. -- Inherited from Vdo_base_object 
  4. Vdo_anim_object = Vdo_base_object:new_base() 
  5.  
  6.  
  7. function Vdo_anim_object:set_child_tween_reverse(reverse) 
  8. 	return vint_set_child_tween_reverse(self.handle, reverse, self.doc_handle) 
  9. end 
  10.  
  11. --[[ 
  12.  
  13. This is legacy method... use Vdo_anim_object:set_target_handle(target_handle) 
  14. (JMH - 6/16/2010) 
  15. function Vdo_anim_object:set_child_tween_target_handle(target_handle) 
  16. 	return vint_set_child_tween_target_handle(self.handle, target_handle, self.doc_handle) 
  17. end 
  18.  
  19. This is probably not needed because the states of tweens should be handled by the state of the parent animation. (JMH - 6/16/2010) 
  20. function Vdo_anim_object:set_child_tween_state(state) 
  21. 	return vint_set_child_tween_state(self.handle, state, self.doc_handle) 
  22. end 
  23.  
  24. Not sure what this is for... (JMH - 6/16/2010) 
  25. function Vdo_anim_object:reset_child_tween_object() 
  26. 	return vint_reset_child_tween_object(self.handle, self.doc_handle) 
  27. end 
  28. ]] 
  29.  
  30. -- Starts a tween on an animation 
  31. -- 
  32. -- start_time: (optional) start time to set, defaults to vint_get_time_index() 
  33. function Vdo_anim_object:play(start_time) 
  34. 	start_time = start_time or 0 
  35. 	local current_time_idx = vint_get_time_index(self.doc_handle) 
  36. 	 
  37. 	--are we paused? 
  38. 	if self:get_property("is_paused") == true then 
  39. 			self:set_property("is_paused", false) 
  40. 	end 
  41. 	 
  42. 	return self:set_property("start_time", start_time + current_time_idx) 
  43. end 
  44.  
  45. -- Disables the tween on the animation 
  46. function Vdo_anim_object:stop() 
  47. 	return self:set_property("is_paused", true) 
  48. end 
  49.  
  50. function Vdo_anim_object:pause() 
  51. 	return self:set_property("is_paused", true) 
  52. end 
  53.  
  54. function Vdo_anim_object:unpause() 
  55. 	return self:set_property("is_paused", false) 
  56. end 
  57.  
  58. function Vdo_anim_object:set_reverse(value) 
  59. 	return self:set_property("reverse", value) 
  60. end 
  61.  
  62. function Vdo_anim_object:set_target_handle(target_handle) 
  63. 	return self:set_property("target_handle", target_handle) 
  64. end 
  65.  
  66. -- Also define a tween object 
  67. Vdo_tween_object = Vdo_base_object:new_base() 
  68.  
  69. function Vdo_tween_object:set_target_handle(target_handle) 
  70. 	return self:set_property("target_handle", target_handle) 
  71. end 
  72.  
  73. function Vdo_tween_object:set_target_name(target_name) 
  74. 	return self:set_property("target_name", target_name) 
  75. end 
  76.  
  77. function Vdo_tween_object:set_start_value(...) 
  78. 	return self:set_property("start_value", ...) 
  79. end 
  80.  
  81. function Vdo_tween_object:set_end_value(...) 
  82. 	return self:set_property("end_value", ...) 
  83. end 
  84.  
  85. function Vdo_tween_object:get_end_value() 
  86. 	return self:get_property("end_value") 
  87. end 
  88.  
  89. function Vdo_tween_object:get_start_value() 
  90. 	return self:get_property("start_value") 
  91. end 
  92.  
  93. function Vdo_tween_object:set_start_event(start_event) 
  94. 	return self:set_property("start_event", start_event) 
  95. end 
  96.  
  97. function Vdo_tween_object:set_end_event(end_event) 
  98. 	return self:set_property("end_event", end_event) 
  99. end 
  100.  
  101. function Vdo_tween_object:set_event_reference(ref) 
  102. 	return vint_set_tween_event_reference(self.handle, ref, self.doc_handle) 
  103. end 
  104.  
  105. function Vdo_tween_object:clear_event_reference() 
  106. 	return vint_clear_tween_event_reference(self.handle, self.doc_handle) 
  107. end