-- Make sure vdo_base_object is loaded first!
-- Inherited from Vdo_base_object
Vdo_anim_object = Vdo_base_object:new_base()
function Vdo_anim_object:set_child_tween_reverse(reverse)
return vint_set_child_tween_reverse(self.handle, reverse, self.doc_handle)
end
--[[
This is legacy method... use Vdo_anim_object:set_target_handle(target_handle)
(JMH - 6/16/2010)
function Vdo_anim_object:set_child_tween_target_handle(target_handle)
return vint_set_child_tween_target_handle(self.handle, target_handle, self.doc_handle)
end
This is probably not needed because the states of tweens should be handled by the state of the parent animation. (JMH - 6/16/2010)
function Vdo_anim_object:set_child_tween_state(state)
return vint_set_child_tween_state(self.handle, state, self.doc_handle)
end
Not sure what this is for... (JMH - 6/16/2010)
function Vdo_anim_object:reset_child_tween_object()
return vint_reset_child_tween_object(self.handle, self.doc_handle)
end
]]
-- Starts a tween on an animation
--
-- start_time: (optional) start time to set, defaults to vint_get_time_index()
function Vdo_anim_object:play(start_time)
start_time = start_time or 0
local current_time_idx = vint_get_time_index(self.doc_handle)
--are we paused?
if self:get_property("is_paused") == true then
self:set_property("is_paused", false)
end
return self:set_property("start_time", start_time + current_time_idx)
end
-- Disables the tween on the animation
function Vdo_anim_object:stop()
return self:set_property("is_paused", true)
end
function Vdo_anim_object:pause()
return self:set_property("is_paused", true)
end
function Vdo_anim_object:unpause()
return self:set_property("is_paused", false)
end
function Vdo_anim_object:set_reverse(value)
return self:set_property("reverse", value)
end
function Vdo_anim_object:set_target_handle(target_handle)
return self:set_property("target_handle", target_handle)
end
-- Also define a tween object
Vdo_tween_object = Vdo_base_object:new_base()
function Vdo_tween_object:set_target_handle(target_handle)
return self:set_property("target_handle", target_handle)
end
function Vdo_tween_object:set_target_name(target_name)
return self:set_property("target_name", target_name)
end
function Vdo_tween_object:set_start_value(...)
return self:set_property("start_value", ...)
end
function Vdo_tween_object:set_end_value(...)
return self:set_property("end_value", ...)
end
function Vdo_tween_object:get_end_value()
return self:get_property("end_value")
end
function Vdo_tween_object:get_start_value()
return self:get_property("start_value")
end
function Vdo_tween_object:set_start_event(start_event)
return self:set_property("start_event", start_event)
end
function Vdo_tween_object:set_end_event(end_event)
return self:set_property("end_event", end_event)
end
function Vdo_tween_object:set_event_reference(ref)
return vint_set_tween_event_reference(self.handle, ref, self.doc_handle)
end
function Vdo_tween_object:clear_event_reference()
return vint_clear_tween_event_reference(self.handle, self.doc_handle)
end