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 )
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)
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)
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)
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('95a799')) 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)
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('95a799')) 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)