Ejemplo n.º 1
0
 def setBackgroundColor(self, color):
     if str(type(color)).find('str'):
         color = draw.color2Array(color)
     if len(color) == 3:
         color += [255]
     self.bgColor = color[:]
     pyglet.gl.glClearColor(color[0] / 255.0, color[1] / 255.0,
                            color[2] / 255.0, color[3] / 255.0)
Ejemplo n.º 2
0
 def setBackgroundColor(self, color):
     if str(type(color)).find('str'):
         color = draw.color2Array(color)
     if len(color) == 3:
         color += [255]
     self.bgColor = color[:]
     pyglet.gl.glClearColor(
         color[0] / 255.0, color[1] / 255.0, color[2] / 255.0, color[3] / 255.0)
Ejemplo n.º 3
0
 def __init__(self, heading, value, x, y, color, desc=''):
     self.value = value
     self.x = x
     self.y = y
     if str(type(color)).find('str') > -1:
         color = color2Array(color)
     self.color = color
     self.heading = pyglet.text.Label(heading, x=x + self.w // 2, y=y - 10, anchor_x='center',
                                      anchor_y='top', font_size=self.header_size, font_name='Verdana')
     self.desc = pyglet.text.Label(
         desc, x=x + 10, y=self.heading.y - 50, width=self.w - 20, multiline=True)
Ejemplo n.º 4
0
class Colors():

    yellow = [255, 255, 0]
    blue = [0, 0, 255]
    green = [0, 255, 0]
    black = [0, 0, 0]
    white = [255, 255, 255]
    red = [255, 0, 0]
    pink = [255, 0, 255]
    solarized = color2Array('#002b36')  # base03

    def __init__(self):
        pass
Ejemplo n.º 5
0
 def __init__(self, heading, value, x, y, color, desc=''):
     self.value = value
     self.x = x
     self.y = y
     if str(type(color)).find('str') > -1:
         color = color2Array(color)
     self.color = color
     self.heading = pyglet.text.Label(heading,
                                      x=x + self.w // 2,
                                      y=y - 10,
                                      anchor_x='center',
                                      anchor_y='top',
                                      font_size=self.header_size,
                                      font_name='Verdana')
     self.desc = pyglet.text.Label(desc,
                                   x=x + 10,
                                   y=self.heading.y - 50,
                                   width=self.w - 20,
                                   multiline=True)
Ejemplo n.º 6
0
    def __init__(self, title, width, height, **kwargs):

        super().__init__(title, width, height, **kwargs)

        self.cText = ''
        self.negative = 0

        self.answerBox = draw.rectangle(self.width // 2 - 100,
                                        self.description.y - 200,
                                        200,
                                        50,
                                        filled=True,
                                        color=draw.color2Array('ff0000'))
        self.lblAnswer = pyglet.text.Label('',
                                           x=self.width // 2,
                                           anchor_x='center',
                                           y=self.description.y - 200 - 10,
                                           anchor_y='top',
                                           font_size=20)

        self.window.push_handlers(on_draw=self.template_on_draw)
        self.window.push_handlers(on_text=self.on_text,
                                  on_text_motion=self.on_text_motion,
                                  on_draw=self.on_draw)
Ejemplo n.º 7
0
    def __init__(self, title, width, height, **kwargs):

        super().__init__(title, width, height, **kwargs)

        self.cText = ''
        self.negative = 0

        self.answerBox = draw.rectangle(
            self.width // 2 - 100, self.description.y - 200, 200, 50, filled=True, color=draw.color2Array('ff0000'))
        self.lblAnswer = pyglet.text.Label(
            '', x=self.width // 2, anchor_x='center', y=self.description.y - 200 - 10, anchor_y='top', font_size=20)

        self.window.push_handlers(on_draw=self.template_on_draw)
        self.window.push_handlers(
            on_text=self.on_text, on_text_motion=self.on_text_motion, on_draw=self.on_draw)