def show(self): """Override initial display to create update schedule and reused gradient fills.""" Screen.show(self) self.ground = cairo.LinearGradient(0, -0.5, 0, 0.5) self.ground.add_color_stop_rgb(0, 87/255.0, 153/255.0, 10/255.0) self.ground.add_color_stop_rgb(1, 0, 123/255.0, 0) self.sky = cairo.LinearGradient(0, -0.5, 0, 0.5) self.sky.add_color_stop_rgb(0, 0, 107/255.0, 214/255.0) self.sky.add_color_stop_rgb(1, 30/255.0, 148/255.0, 1) self.set_visible(True)
def show(self): """Override initial display to create update schedule and reused gradient fills.""" Screen.show(self) self.ground = cairo.LinearGradient(0, -0.5, 0, 0.5) self.ground.add_color_stop_rgb(0, 87 / 255.0, 153 / 255.0, 10 / 255.0) self.ground.add_color_stop_rgb(1, 0, 123 / 255.0, 0) self.sky = cairo.LinearGradient(0, -0.5, 0, 0.5) self.sky.add_color_stop_rgb(0, 0, 107 / 255.0, 214 / 255.0) self.sky.add_color_stop_rgb(1, 30 / 255.0, 148 / 255.0, 1) self.set_visible(True)
def __init__(self, provider): """Initialise the information provider. This is responsible for having a {{position}} method which returns an x, y, z tuple.""" Screen.__init__(self) self.provider = provider