def CreateTimerCycleLayout(self):
     self.circleSprite = sprite.Sprite(
         name='icon',
         parent=self.content,
         pos=(0, 0, 32, 32),
         texturePath='res:/UI/Texture/Crimewatch/Crimewatch_TimerCircle.png',
         state=uiconst.UI_DISABLED,
         align=uiconst.CENTER,
         opacity=ALPHA_EMPTY)
     self.halfCircleSprite = sprite.Sprite(
         name='half_circle',
         parent=self.content,
         width=32,
         height=32,
         rotation=0 if self.countsDown else pi,
         texturePath=
         'res:/UI/Texture/Crimewatch/Crimewatch_TimerHalfCircle.png',
         state=uiconst.UI_DISABLED)
     self.clipContainer = container.Container(name='clipper',
                                              parent=self.content,
                                              width=16,
                                              align=uiconst.TOLEFT,
                                              clipChildren=True,
                                              state=uiconst.UI_DISABLED)
     self.cycleContainer = transform.Transform(name='cycle_container',
                                               parent=self.clipContainer,
                                               width=32,
                                               height=32)
     self.cycleSprite = sprite.Sprite(
         name='cycle_half_circle',
         parent=self.cycleContainer,
         width=32,
         height=32,
         rotation=pi if self.countsDown else 0,
         texturePath=
         'res:/UI/Texture/Crimewatch/Crimewatch_TimerHalfCircle.png',
         state=uiconst.UI_DISABLED)
     self.pointerContainer = transform.Transform(name='pointer_container',
                                                 parent=self.content,
                                                 width=32,
                                                 height=32,
                                                 idx=0)
     self.pointerClipper = container.Container(parent=self.pointerContainer,
                                               pos=(9, -10, 15, 13),
                                               clipChildren=True,
                                               align=uiconst.TOPLEFT,
                                               state=uiconst.UI_DISABLED)
     self.pointerSprite = sprite.Sprite(
         name='cycle_pointer',
         parent=self.pointerClipper,
         pos=(0, 0, 15, 19),
         texturePath=
         'res:/UI/Texture/Crimewatch/Crimewatch_TimerPoint_WithShadow.png',
         align=uiconst.TOPLEFT,
         state=uiconst.UI_DISABLED)
 def CreateMainContentLayout(self):
     self.content = transform.Transform(parent=self,
                                        name='content',
                                        align=uiconst.CENTER,
                                        pos=(0, 0, 32, 32),
                                        state=uiconst.UI_NORMAL)
     self.content.OnMouseEnter = self.OnMouseEnter
Esempio n. 3
0
 def ApplyAttributes(self, attributes):
     container.Container.ApplyAttributes(self, attributes)
     self.content = transform.Transform(parent=self,
                                        name='content',
                                        align=uiconst.CENTER,
                                        pos=(0, 0, 70, 70),
                                        state=uiconst.UI_NORMAL)
     self.background = sprite.Sprite(
         name='icon',
         parent=self.content,
         pos=(0, 0, 70, 70),
         texturePath='res:/UI/Texture/classes/DamageRing/background.png',
         state=uiconst.UI_DISABLED,
         align=uiconst.CENTER)
     self.shield = DamageSegment(
         name='shield',
         parent=self.content,
         texturePath='res:/UI/Texture/classes/DamageRing/shield.png',
         offset=-0.98)
     self.armor = DamageSegment(
         name='armor',
         parent=self.content,
         texturePath='res:/UI/Texture/classes/DamageRing/armor.png',
         offset=-5.17)
     self.hull = DamageSegment(
         name='hull',
         parent=self.content,
         texturePath='res:/UI/Texture/classes/DamageRing/hull.png',
         offset=-3.1)
 def CreateIconLayout(self, attributes):
     if attributes.icon:
         self.iconTransform = transform.Transform(parent=self.content,
                                                  name='iconTransform',
                                                  align=uiconst.CENTER,
                                                  width=16,
                                                  height=16,
                                                  state=uiconst.UI_DISABLED)
         self.icon = sprite.Sprite(name='icon',
                                   parent=self.iconTransform,
                                   pos=(0, 0, 16, 16),
                                   texturePath=attributes.icon,
                                   state=uiconst.UI_DISABLED,
                                   align=uiconst.CENTER)
         self.iconTransform.scalingCenter = (0.5, 0.5)
     else:
         self.icon = None