mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
add resume_until
This commit is contained in:
parent
468f61e27b
commit
80862fe41a
@ -110,9 +110,23 @@ class Interval(DirectObject):
|
||||
self.__removeTask()
|
||||
return self.getT()
|
||||
|
||||
def resume(self, t0 = None):
|
||||
if t0 != None:
|
||||
self.setT(t0)
|
||||
def resume(self, startT = None):
|
||||
if startT != None:
|
||||
self.setT(startT)
|
||||
self.setupResume()
|
||||
if not self.isPlaying():
|
||||
self.__spawnTask()
|
||||
|
||||
def resumeUntil(self, endT):
|
||||
duration = self.getDuration()
|
||||
|
||||
if endT < 0 or endT >= duration:
|
||||
self.__endT = duration
|
||||
self.__endTAtEnd = 1
|
||||
else:
|
||||
self.__endT = endT
|
||||
self.__endTAtEnd = 0
|
||||
|
||||
self.setupResume()
|
||||
if not self.isPlaying():
|
||||
self.__spawnTask()
|
||||
|
@ -187,6 +187,30 @@ resume(double start_t) {
|
||||
_manager->add_c_interval(this, false);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CInterval::resume_until
|
||||
// Access: Published
|
||||
// Description: Restarts the interval from the current point after a
|
||||
// previous call to pause() (or a previous
|
||||
// play-to-point-and-stop), to play until the indicated
|
||||
// point and then stop.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CInterval::
|
||||
resume_until(double end_t) {
|
||||
double duration = get_duration();
|
||||
|
||||
if (end_t < 0.0 || end_t >= duration) {
|
||||
_end_t = duration;
|
||||
_end_t_at_end = true;
|
||||
} else {
|
||||
_end_t = end_t;
|
||||
_end_t_at_end = false;
|
||||
}
|
||||
|
||||
setup_resume();
|
||||
_manager->add_c_interval(this, false);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CInterval::finish
|
||||
// Access: Published
|
||||
|
@ -91,6 +91,7 @@ PUBLISHED:
|
||||
double pause();
|
||||
void resume();
|
||||
void resume(double start_t);
|
||||
void resume_until(double end_t);
|
||||
void finish();
|
||||
bool is_playing() const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user