예제 #1
0
 def AnimateSpinningCircleEnter(self, curveSet, timeOffset):
     animations.FadeTo(self.wheelSpriteOuter,
                       startVal=0.0,
                       endVal=self.spinnerOpacity,
                       duration=0.5,
                       timeOffset=timeOffset)
     animations.FadeTo(self.wheelSpriteInner,
                       startVal=0.0,
                       endVal=self.spinnerOpacity,
                       duration=0.5,
                       timeOffset=timeOffset)
     animations.Tr2DRotateTo(self.wheelSpriteInner,
                             startAngle=2 * math.pi,
                             endAngle=0.0,
                             loops=uiconst.ANIM_REPEAT,
                             duration=60.0,
                             curveType=uiconst.ANIM_LINEAR,
                             curveSet=curveSet)
     animations.Tr2DRotateTo(self.wheelSpriteOuter,
                             startAngle=0.0,
                             endAngle=2 * math.pi,
                             loops=uiconst.ANIM_REPEAT,
                             duration=40.0,
                             curveType=uiconst.ANIM_LINEAR,
                             curveSet=curveSet)
예제 #2
0
 def setup_busy_indicator(self):
     count = 0
     prevRotation = 0
     delta = 1.04719755
     self.busy_indicator_container = uiprimitives.Container(name='busyIndicatorContainer', parent=self.processing_container, bgTexturePath='res:/UI/Texture/classes/ProjectDiscovery/busyIndicatorCircle.png', width=36, height=36, align=uiconst.CENTERLEFT, left=120)
     self.busy_indicator_hex = uiprimitives.Transform(name='busyIndicatorHex', parent=self.busy_indicator_container, bgTexturePath='res:/UI/Texture/classes/ProjectDiscovery/busyIndicatorHex.png', width=10, height=10, align=uiconst.CENTER)
     animations.Tr2DRotateTo(self.busy_indicator_hex, endAngle=self.busy_indicator_hex.rotation - delta, loops=uiconst.ANIM_REPEAT)
     while count < 6:
         count += 1
         triangle = uiprimitives.Transform(name='busyIndicatorTriangle', parent=self.busy_indicator_container, bgTexturePath='res:/UI/Texture/classes/ProjectDiscovery/busyIndicatorTriangle.png', width=8, height=8, align=uiconst.CENTER, top=12, rotationCenter=(0.5, -1.0), rotation=prevRotation + delta)
         prevRotation = triangle.rotation
         animations.Tr2DRotateTo(triangle, startAngle=triangle.rotation, endAngle=triangle.rotation - delta, loops=uiconst.ANIM_REPEAT)
예제 #3
0
파일: window.py 프로젝트: connoryang/1v1dec
 def update_accuracy_meter(self):
     animations.Tr2DRotateTo(
         self.accuracyNeedleIconContainer,
         startAngle=self.accuracyNeedleIconContainer.rotation,
         endAngle=self.needle_Rotation,
         curveType=uiconst.ANIM_LINEAR)
     self.accuracyArcFill.MakeArc(radius=0,
                                  outerRadius=10,
                                  fromDeg=-225.0,
                                  toDeg=self.score * 265 - 225.0,
                                  outerColor=(1.0, 1.0, 0, 0.7),
                                  innerColor=(1.0, 1.0, 0, 0.7))
예제 #4
0
    def Collapse(self):
        animations.Tr2DRotateTo(self.arrow,
                                endAngle=math.pi / 2.0,
                                duration=0.15)
        reverseSortedEntries = reversed(
            sorted(self._entries, key=self._GetEntrySortKey))
        for i, entry in enumerate(reverseSortedEntries):
            entry.Disable()
            animations.FadeTo(entry,
                              startVal=1.0,
                              endVal=0.0,
                              duration=0.2,
                              timeOffset=i * 0.02)
            animations.MoveTo(
                entry,
                startPos=(0, 0),
                endPos=(0, -(entry.height + entry.padTop + entry.padBottom)),
                duration=0.2,
                timeOffset=i * 0.02 + 0.1)

        sleepDuration = len(self._entries) * 0.02 + 0.3
        blue.synchro.SleepWallclock(sleepDuration * 1000)
예제 #5
0
    def Expand(self):
        animations.Tr2DRotateTo(self.arrow,
                                startAngle=math.pi / 2.0,
                                endAngle=0.0,
                                duration=0.15)
        sortedEntries = sorted(self._entries, key=self._GetEntrySortKey)
        for i, entry in enumerate(sortedEntries):
            entry.display = True
            animations.MoveTo(
                entry,
                startPos=(0, -(entry.height + entry.padTop + entry.padBottom)),
                endPos=(0, 0),
                duration=0.2,
                timeOffset=i * 0.02)
            animations.FadeTo(entry,
                              startVal=0.0,
                              endVal=1.0,
                              duration=0.2,
                              timeOffset=i * 0.02 + 0.1,
                              callback=entry.Enable)

        sleepDuration = len(self._entries) * 0.02 + 0.3
        blue.synchro.SleepWallclock(sleepDuration * 1000)
예제 #6
0
 def OnSweepStarted(self, systemReadyTime, durationInSec, viewAngleInPlane,
                    orderedDelayAndSiteList, sweepStartDelayMSec):
     logger.debug(
         'OnSweepStarted readyTime=%s durationInSec=%s angle=%s sweepStartDelayMSec=%s',
         systemReadyTime, durationInSec, viewAngleInPlane,
         sweepStartDelayMSec)
     timeNow = blue.os.GetWallclockTime()
     timeSinceStartSec = float(timeNow - systemReadyTime) / SEC
     if timeSinceStartSec > sweepStartDelayMSec:
         logger.debug(
             'OnSweepStarted too late. timeSinceStartSec=%s timeNow=%s',
             timeSinceStartSec, timeNow)
         self.UpdateVisibleSites()
         self.OnSweepEnded()
         return
     timeOffset = sweepStartDelayMSec - timeSinceStartSec
     self.UpdateVisibleSites()
     animations.FadeTo(self.sweepTransform,
                       duration=durationInSec,
                       startVal=0.0,
                       endVal=0.0,
                       curveType=((0.05, 1.0), (0.95, 1.0)),
                       timeOffset=timeOffset)
     viewAngleInPlane += MATH_PI_2
     animations.Tr2DRotateTo(self.sweepTransform,
                             duration=durationInSec,
                             startAngle=viewAngleInPlane,
                             endAngle=viewAngleInPlane + MATH_2_PI,
                             curveType=uiconst.ANIM_LINEAR,
                             timeOffset=timeOffset)
     for delaySec, siteData in orderedDelayAndSiteList:
         indicator = self.siteIndicatorsBySiteID.get(siteData.siteID)
         if indicator:
             animations.FadeIn(indicator,
                               duration=0.2,
                               curveType=uiconst.ANIM_OVERSHOT,
                               timeOffset=delaySec - timeSinceStartSec)