예제 #1
0
파일: core.py 프로젝트: endrift/cwriting
    def _genDiff(self, current, next):
        key = (next['object'], next['property'])
        if key in current:
            diff = current[key]['value'].genDiff(current[key], next)
            if diff:
                ta = node.TimedActions(current[key]['time'])
                ta.addAction(next['object'].encloseDiff(diff))
                self._changes.append(ta)

        current[key] = next
예제 #2
0
파일: core.py 프로젝트: endrift/cwriting
    def freeze(self, loop=False):
        self._changes = []
        self._loop = loop
        current = {}

        for next in self._previous:
            self._genDiff(current, next)

        for next in self._current.itervalues():
            self._genDiff(current, next)

        for i in self._instants:
            self._changes.append(i)

        if loop:
            ta = node.TimedActions(self._time)
            ta.addAction(node.TimerChange(self))
            self._changes.append(ta)
예제 #3
0
파일: core.py 프로젝트: endrift/cwriting
 def restart(self):
     ta = node.TimedActions(self._time)
     ta.addAction(node.Restart())
     self._instants.append(ta)
예제 #4
0
파일: core.py 프로젝트: endrift/cwriting
 def playSound(self, sound):
     ta = node.TimedActions(self._time)
     ta.addAction(node.SoundRef(sound))
     self._instants.append(ta)
예제 #5
0
파일: core.py 프로젝트: endrift/cwriting
 def changeLink(self, link, enable):
     ta = node.TimedActions(self._time)
     o = node.ObjectChange(link)
     o.addChild(node.LinkChange('link_' + ('on' if enable else 'off')))
     ta.addAction(o)
     self._instants.append(ta)
예제 #6
0
파일: core.py 프로젝트: endrift/cwriting
 def changeTimeline(self, other, action='start'):
     ta = node.TimedActions(self._time)
     ta.addAction(node.TimerChange(other))
     self._instants.append(ta)