added a fade_in effect to the knobs
This commit is contained in:
7
main.py
7
main.py
@ -18,6 +18,8 @@ class GuiMain:
|
||||
self.screenH = self.screen.get_height()
|
||||
self.screenW = self.screen.get_width()
|
||||
|
||||
self.label_surface = pygame.Surface((self.screenW, self.screenH), pygame.SRCALPHA)
|
||||
|
||||
self.fx_mode_labels = [
|
||||
'Strings',
|
||||
'Beat',
|
||||
@ -74,8 +76,10 @@ class GuiMain:
|
||||
else: component.color = color_primary
|
||||
|
||||
def set_fx_mode(self, mode):
|
||||
self.knobs[self.fx_mode].opacity = 0
|
||||
self.fx_mode = self.fx_mode_labels.index(mode)
|
||||
self.knobs[self.fx_mode].set_focused(None)
|
||||
self.knobs[self.fx_mode].fade_in = True
|
||||
for b in self.fx_mode_buttons:
|
||||
b.focused = (b.name == mode)
|
||||
|
||||
@ -92,6 +96,9 @@ class GuiMain:
|
||||
|
||||
# RENDER YOUR GAME HERE
|
||||
|
||||
self.screen.blit(self.label_surface, (0,0))
|
||||
self.label_surface = pygame.Surface((self.screenW, self.screenH), pygame.SRCALPHA)
|
||||
|
||||
self.knobs[self.fx_mode].display()
|
||||
|
||||
for button in self.fx_mode_buttons:
|
||||
|
||||
Reference in New Issue
Block a user