def render(self, surface): Block.render(self, surface) if (self.mouseInside): x, y = self.position if (self.visible): surface.blit(self.textSurface, (x + 5, y + 5)) else: Label.render(self, surface)
def __init__(self): KeyboardObserveable.__init__(self) Block.__init__(self) self.key = 0 self.backdrop = ImageChange(200) for i in range(24): self.backdrop.addKeyFrame(i / 23, i) self.backdrop.circular = True self.addAnimation(self.backdrop)
def draw(self): Block.draw(self) w, h = self.Awating.size w1, h1 = self.Play.size w2, h2 = self.Loop.size x, y = self.size self.Awating.setPosition((x - w - w1 - w2, 0)) self.Play.setPosition((x - w1 - w2, 0)) self.Loop.setPosition((x - w2, 0))
def createImage(self): Block.createImage(self) from visible import Window img = Window.get_image_registry().get_item(BeatTile.Fade) if (img): self.backdrop.setImage(img) return img = ImageSequence(self.size) img.addSprite(RadialGlow) Window.get_image_registry().registerImage(img, BeatTile.Fade) self.backdrop.setImage(img) img.draw()
def __init__(self): Block.__init__(self) KeyboardObserveable.__init__(self) self.squence = Sequencer() self.addAnimation(self.squence) label = Label("Record") self.addItem(label) self.Awating = Button("<>", self.toggleRecording) self.Play = Button(">>", self.run) self.Loop = Button(">o<", self.setLoop) self.addItem(self.Awating) self.addItem(self.Play) self.addItem(self.Loop)
def __init__(self, onset): Block.__init__(self) KeyboardObserveable.__init__(self) self.Listening = Label("Awaiting input...") self.Idle = Label("Change key") self.Awaiting = Button("><") self.addItem(self.Listening) self.addItem(self.Idle) self.addItem(self.Awaiting) self.Listening.visible = False self.setSize((200, 25)) self.Awaiting.setSize((25, 25)) self.Awaiting.setPosition((175, 0)) self.waiting = False self.onSet = onset pass
def draw(self): Block.draw(self)
def __init__(self): Block.__init__(self)
def draw(self): Label.draw(self) Block.draw(self)
def __init__(self, text="Button", action=None): Label.__init__(self, text) Block.__init__(self) self.action = action