コード例 #1
0
 def __init__(self):
     self.dummy = BigWorld.Model('')
     self.turnTrigger = self.angleGizmo(red=False)
     self.turnCancel = self.angleGizmo(red=True)
     self.strafeTrigger = self.angleGizmo2(red=False)
     self.speedTrigger = self.rulerGizmo(red=False)
     self.speedCancel = self.rulerGizmo(red=True)
     self.guiAttachment = GUI.Attachment()
     self.actionText = GUI.Text('')
     self.guiAttachment.component = self.actionText
コード例 #2
0
 def rulerGizmo(self, red=False):
     f = GUI.Frame2('helpers/maps/ruler.tga')
     f.transform = GUI.MatrixShader()
     f.transform.target = Math.Matrix()
     f.transform.target.setRotateX(1.57)
     f.verticalAnchor = 'BOTTOM'
     f.filterType = 'LINEAR'
     f.colour = [(92, 255, 92, 255), (255, 92, 92, 255)][red]
     f.size = (1.0, 5.0)
     tr = Math.Matrix()
     tr.setTranslate((0, 0, -1))
     f.transform.target.preMultiply(tr)
     att = GUI.Attachment()
     att.component = f
     return att
コード例 #3
0
 def __create3DText(self, position, text, color, textSize):
     if self.reuse3DTexts:
         model, motor, component = self.reuse3DTexts.pop()
     else:
         attachment = GUI.Attachment()
         component = GUI.Text(text)
         attachment.component = component
         attachment.faceCamera = True
         motor = BigWorld.Servo(mathUtils.createTranslationMatrix(position))
         model = BigWorld.Model('')
         model.addMotor(motor)
         BigWorld.addModel(model, self.spaceID)
         model.root.attach(attachment)
         component.visible = True
         component.multiline = True
         component.explicitSize = True
         component.filterType = 'LINEAR'
         component.verticalAnchor = 'BOTTOM'
     component.text = text
     component.size = (0, textSize)
     component.colour = color
     motor.signal = mathUtils.createTranslationMatrix(position)
     return (model, motor, component)