ON_BOTTOM_LUMINANCE = 0.9
ON_SATURATION = 1
-class _PlayingScreenBase(pygame.sprite.Group) :
+class _PlayingScreenBase(pygame.sprite.OrderedUpdates) :
def __init__(self, distinctNotes=[]) :
"""
distinctNotes : notes disctinctes présentes dans la chanson
c = Column(hue, rect)
self.add(c)
-
- def drawColumns(self) :
- pass
-
+
def highlightColumn(self, index) :
for i, sprite in enumerate(self.sprites()) :
sprite.update(i==index)
+ self.draw(pygame.display.get_surface())
o.midi=1
super(SongPlayingScreenTest, self).__init__([o])
self.__running = True
- pygame.display.flip()
- #while self.__running :
- # events = pygame.event.get()
- # for event in events:
- # self.input(event)
- # pygame.display.flip()
+ #pygame.display.flip()
+ #raw_input('allez ?')
+
+ def run(self):
+ while self.__running :
+ pygame.display.flip()
+ events = pygame.event.get()
+ for event in events:
+ self.input(event)
def input(self, event) :
if event.type == pygame.KEYDOWN:
topRgba = hls_to_rgba_8bits(hue, ON_TOP_LUMINANCE, ON_SATURATION)
bottomRgba = hls_to_rgba_8bits(hue, ON_BOTTOM_LUMINANCE, ON_SATURATION)
size = rect.inflate(2*rect.width,0).size
- self.stateOn = gradients.vertical(rect.size, topRgba, bottomRgba)
+ print rect.size, size
+ self.stateOn = gradients.vertical(size, topRgba, bottomRgba)
- self.image = self.stateOn
+ self.image = self.stateOff
self.rect = rect
def update(self, state) :