def draw(self):
     if self.isActive:
         glColor3f(0.3, 0.3, 0.3)
         offset = self.currentChoice * self.spacing 
         drawutils.drawRoundRectangle(self.x, self.y - offset, self.x + self.w, self.y - offset + self.spacing * len(self.choices), 4)
         glColor3f(1,1,1)
         for n in range(len(self.choices)):
             self.font.drawString(self.choices[n], self.x + 4, self.y + self.h - 8 - (self.currentChoice - n) * self.spacing)
         glColor3f(0.6, 0.6, 0.6)
         glBegin(GL_TRIANGLES)
         glVertex3f(self.x + self.w - 10, self.y + self.h/2 - 5, self.z)
         glVertex3f(self.x + self.w - 10 - 4, self.y + self.h/2 - 5 + 4, self.z)
         glVertex3f(self.x + self.w - 10 + 7, self.y + self.h/2 - 5 + 4, self.z)
         
         glVertex3f(self.x + self.w - 10, self.y + self.h/2 + 5, self.z)
         glVertex3f(self.x + self.w - 10 + 7, self.y + self.h/2 + 1, self.z)                
         glVertex3f(self.x + self.w - 10 - 4, self.y + self.h/2 + 1, self.z)
         glEnd()            
     else:
         glColor3f(0.5, 0.5, 0.5)
         drawutils.drawRoundRectangle(self.x, self.y, self.x + self.w, self.y + self.h, 4)
     
         glColor3f(1,1,1)
         self.font.drawString(self.choices[self.currentChoice], self.x + 4, self.y + self.h - 8)
         glColor3f(0.8, 0.8, 0.8)
         glBegin(GL_TRIANGLES)
         glVertex3f(self.x + self.w - 10, self.y + self.h/2 - 5, self.z)
         glVertex3f(self.x + self.w - 10 - 4, self.y + self.h/2 - 5 + 4, self.z)
         glVertex3f(self.x + self.w - 10 + 7, self.y + self.h/2 - 5 + 4, self.z)
         
         glVertex3f(self.x + self.w - 10, self.y + self.h/2 + 5, self.z)
         glVertex3f(self.x + self.w - 10 + 7, self.y + self.h/2 + 1, self.z)                
         glVertex3f(self.x + self.w - 10 - 4, self.y + self.h/2 + 1, self.z)
         glEnd()
 def draw(self):
     if self.mouseState ==  MouseTweaker.MOUSE_DRAGGING_US:
         glColor3f(0.5,0.5,0.5)
     else:
         apply(glColor3f, self.color)
     drawutils.drawRoundRectangle(self.x, self.y, self.x + self.w, self.y + self.h, 4)
     if self.label and self.showLabel:
         glColor3f(1,1,1)
         self.font.drawString(self.label, self.x + self.w/2 - self.labelWidth/2, self.y + self.h/2 + 2)
     if self.image:
         self.image.draw(self.x, self.y)
示例#3
0
 def draw(self):
     if self.mouseState == MouseTweaker.MOUSE_DRAGGING_US:
         glColor3f(0.5, 0.5, 0.5)
     else:
         apply(glColor3f, self.color)
     drawutils.drawRoundRectangle(self.x, self.y, self.x + self.w,
                                  self.y + self.h, 4)
     if self.label and self.showLabel:
         glColor3f(1, 1, 1)
         self.font.drawString(self.label,
                              self.x + self.w / 2 - self.labelWidth / 2,
                              self.y + self.h / 2 + 2)
     if self.image:
         self.image.draw(self.x, self.y)
    def draw(self):

        if not self.visible:
            return
        
        if self.mouseState ==  MouseTweaker.MOUSE_DRAGGING_US:
            glColor3f(0.5,0.5,0.5)
        else:
            glColor3f(0.3,0.3,0.3)            
        drawutils.drawRoundRectangle(self.x, self.y, self.x + self.w, self.y + self.h, 5)
        glPushMatrix()
        glTranslatef(self.x, self.y, self.z)
        for c in self.children:
            c.draw()
        glPopMatrix()
示例#5
0
    def draw(self):
        if self.isActive:
            glColor3f(0.3, 0.3, 0.3)
            offset = self.currentChoice * self.spacing
            drawutils.drawRoundRectangle(
                self.x, self.y - offset, self.x + self.w,
                self.y - offset + self.spacing * len(self.choices), 4)
            glColor3f(1, 1, 1)
            for n in range(len(self.choices)):
                self.font.drawString(
                    self.choices[n], self.x + 4, self.y + self.h - 8 -
                    (self.currentChoice - n) * self.spacing)
            glColor3f(0.6, 0.6, 0.6)
            glBegin(GL_TRIANGLES)
            glVertex3f(self.x + self.w - 10, self.y + self.h / 2 - 5, self.z)
            glVertex3f(self.x + self.w - 10 - 4, self.y + self.h / 2 - 5 + 4,
                       self.z)
            glVertex3f(self.x + self.w - 10 + 7, self.y + self.h / 2 - 5 + 4,
                       self.z)

            glVertex3f(self.x + self.w - 10, self.y + self.h / 2 + 5, self.z)
            glVertex3f(self.x + self.w - 10 + 7, self.y + self.h / 2 + 1,
                       self.z)
            glVertex3f(self.x + self.w - 10 - 4, self.y + self.h / 2 + 1,
                       self.z)
            glEnd()
        else:
            glColor3f(0.5, 0.5, 0.5)
            drawutils.drawRoundRectangle(self.x, self.y, self.x + self.w,
                                         self.y + self.h, 4)

            glColor3f(1, 1, 1)
            self.font.drawString(self.choices[self.currentChoice], self.x + 4,
                                 self.y + self.h - 8)
            glColor3f(0.8, 0.8, 0.8)
            glBegin(GL_TRIANGLES)
            glVertex3f(self.x + self.w - 10, self.y + self.h / 2 - 5, self.z)
            glVertex3f(self.x + self.w - 10 - 4, self.y + self.h / 2 - 5 + 4,
                       self.z)
            glVertex3f(self.x + self.w - 10 + 7, self.y + self.h / 2 - 5 + 4,
                       self.z)

            glVertex3f(self.x + self.w - 10, self.y + self.h / 2 + 5, self.z)
            glVertex3f(self.x + self.w - 10 + 7, self.y + self.h / 2 + 1,
                       self.z)
            glVertex3f(self.x + self.w - 10 - 4, self.y + self.h / 2 + 1,
                       self.z)
            glEnd()
示例#6
0
    def draw(self):

        if not self.visible:
            return

        if self.mouseState == MouseTweaker.MOUSE_DRAGGING_US:
            glColor3f(0.5, 0.5, 0.5)
        else:
            glColor3f(0.3, 0.3, 0.3)
        drawutils.drawRoundRectangle(self.x, self.y, self.x + self.w,
                                     self.y + self.h, 5)
        glPushMatrix()
        glTranslatef(self.x, self.y, self.z)
        for c in self.children:
            c.draw()
        glPopMatrix()