set_visible_child
This commit is contained in:
parent
32bb8b1b41
commit
1afba99e1f
|
|
@ -88,6 +88,23 @@ get_cycle_rate() const {
|
|||
return cdata->_cycle_rate;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: SequenceNode::set_visible_child
|
||||
// Access: Published
|
||||
// Description: Sets the particular child that this SequenceNode will
|
||||
// display this frame. Future frames will proceed from
|
||||
// here.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void SequenceNode::
|
||||
set_visible_child(int index) {
|
||||
int num_children = get_num_children();
|
||||
if (num_children != 0) {
|
||||
CDWriter cdata(_cycler);
|
||||
float now = ClockObject::get_global_clock()->get_frame_time();
|
||||
cdata->_frame_offset = (index - (now - cdata->_start_time) * cdata->_cycle_rate);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: SequenceNode::get_visible_child
|
||||
// Access: Published
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ PUBLISHED:
|
|||
INLINE void set_cycle_rate(float cycle_rate);
|
||||
INLINE float get_cycle_rate() const;
|
||||
|
||||
INLINE void set_visible_child(int index);
|
||||
INLINE int get_visible_child() const;
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in New Issue