athmos display been bugfixed and can now be switched by the knobs display
This commit is contained in:
@ -27,15 +27,17 @@ class Athmos:
|
||||
if self.show_list:
|
||||
self.surface.fill("black")
|
||||
for i in range(self.get_display_count()):
|
||||
text = self.filenames[(i-self.index-math.floor(self.get_display_count()/2))%len(self.filenames)]
|
||||
if i == math.floor(self.get_display_count()/2):
|
||||
# text = self.filenames[(i-self.index-math.floor(self.get_display_count()/2))%len(self.filenames)]
|
||||
text = self.filenames[i]
|
||||
# if i == math.floor(self.get_display_count()/2):
|
||||
if i == self.index:
|
||||
text_surface = font_helvetica16.render(text, False, "black", color_primary_light)
|
||||
else:
|
||||
text_surface = font_helvetica16.render(text, False, color_primary_light)
|
||||
opacity = math.floor((i+1) * 2 * 255 / MAX_COUNT
|
||||
if i < MAX_COUNT/2
|
||||
else (MAX_COUNT-i) * 2 * 255 / MAX_COUNT)
|
||||
text_surface.set_alpha(opacity)
|
||||
# text_surface.set_alpha(opacity)
|
||||
self.surface.blit(text_surface, ((0, self.surface.get_height()/self.get_display_count()*i)))
|
||||
|
||||
self.screen.blit(self.surface, (self.screen.get_width()/3,
|
||||
|
||||
1
knobs.py
1
knobs.py
@ -142,6 +142,7 @@ class Knobs:
|
||||
self.knobs[index].set_value(value)
|
||||
|
||||
def display(self):
|
||||
if self.gui.show_knobs:
|
||||
if self.fade_in and self.opacity < 255: self.opacity += self.fade_speed
|
||||
if self.fade_out and self.opacity > 0: self.opacity -= self.fade_speed
|
||||
self.knobs_surface = pygame.Surface((self.gui.screenW, self.gui.screenH), pygame.SRCALPHA)
|
||||
|
||||
5
main.py
5
main.py
@ -48,6 +48,7 @@ class GuiMain:
|
||||
self.knobs.append(Knobs(self))
|
||||
|
||||
self.set_fx_mode(self.fx_mode)
|
||||
self.show_knobs = True
|
||||
|
||||
self.mute_button = BinaryButton(
|
||||
self.screen,
|
||||
@ -86,6 +87,10 @@ class GuiMain:
|
||||
for b in self.fx_mode_buttons:
|
||||
b.focused = (b.name == mode)
|
||||
|
||||
def show_athmos(self, show=True):
|
||||
self.athmos.show_list = show
|
||||
self.show_knobs = not show
|
||||
|
||||
def set_athmo_index(self, index):
|
||||
self.athmos.index = index
|
||||
|
||||
|
||||
Reference in New Issue
Block a user