Compare commits
2 Commits
e48012e1c1
...
f7c8df5cfc
| Author | SHA1 | Date | |
|---|---|---|---|
| f7c8df5cfc | |||
| 65d997fb78 |
4
colors.py
Normal file
4
colors.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
color_primary = (0, 190, 180)
|
||||||
|
color_primary_light = (0, 255, 245)
|
||||||
|
color_primary_dark = (0, 120, 115)
|
||||||
40
main.py
40
main.py
@ -1,5 +1,6 @@
|
|||||||
import pygame
|
import pygame
|
||||||
from knob import *
|
from knob import *
|
||||||
|
from colors import *
|
||||||
|
|
||||||
# pygame setup
|
# pygame setup
|
||||||
pygame.init()
|
pygame.init()
|
||||||
@ -7,9 +8,14 @@ screenW = 561
|
|||||||
screenH = 325
|
screenH = 325
|
||||||
screen = pygame.display.set_mode((screenW, screenH))
|
screen = pygame.display.set_mode((screenW, screenH))
|
||||||
|
|
||||||
color_primary = (0, 190, 180)
|
fx_modes = [
|
||||||
color_primary_light = (0, 255, 245)
|
'Strings',
|
||||||
color_primary_dark = (0, 110, 115)
|
'Beat',
|
||||||
|
'L-Loop',
|
||||||
|
'R-Loop',
|
||||||
|
'Jack',
|
||||||
|
'Athmo'
|
||||||
|
]
|
||||||
|
|
||||||
# Create and position the knobs
|
# Create and position the knobs
|
||||||
knobs_radius = screenW / 25
|
knobs_radius = screenW / 25
|
||||||
@ -29,6 +35,7 @@ for i in range(8):
|
|||||||
pygame.font.init() # you have to call this at the start,
|
pygame.font.init() # you have to call this at the start,
|
||||||
# if you want to use this module.
|
# if you want to use this module.
|
||||||
font_helvetica = pygame.font.SysFont('Helvetica', 30)
|
font_helvetica = pygame.font.SysFont('Helvetica', 30)
|
||||||
|
font_helvetica16 = pygame.font.SysFont('Helvetica', 15)
|
||||||
|
|
||||||
clock = pygame.time.Clock()
|
clock = pygame.time.Clock()
|
||||||
running = True
|
running = True
|
||||||
@ -72,6 +79,12 @@ def display_label(index):
|
|||||||
knobs[index].set_value(0.86)
|
knobs[index].set_value(0.86)
|
||||||
knobs[index].set_color(color_primary_light)
|
knobs[index].set_color(color_primary_light)
|
||||||
|
|
||||||
|
def draw_lozi(x, y, color, outlined = False):
|
||||||
|
rX = screenW * 0.35 / 19
|
||||||
|
rY = (screenH-20) / 16
|
||||||
|
w = 2 if outlined else 0
|
||||||
|
pygame.draw.polygon(screen, color, [(x-rX, y), (x, y-rY), (x+rX, y), (x, y+rY)], w)
|
||||||
|
|
||||||
while running:
|
while running:
|
||||||
# poll for events
|
# poll for events
|
||||||
# pygame.QUIT event means the user clicked X to close your window
|
# pygame.QUIT event means the user clicked X to close your window
|
||||||
@ -89,7 +102,26 @@ while running:
|
|||||||
for i in range(8):
|
for i in range(8):
|
||||||
knobs[i].display()
|
knobs[i].display()
|
||||||
|
|
||||||
pygame.draw.polygon(screen, "white", [(0, screenH/2), (screenW*3/19, screenH), (0, screenH)])
|
pygame.draw.rect(screen, color_primary_dark, ((10, 10), (screenW * 1.5 / 19, screenH - 18)))
|
||||||
|
fx_mode = 1
|
||||||
|
for i in range(6):
|
||||||
|
x = screenW * 2.5 / 19
|
||||||
|
y = i * screenH / 7.3 + 35
|
||||||
|
if i == fx_mode:
|
||||||
|
draw_lozi(x, y, color_primary)
|
||||||
|
fx_mode_label = font_helvetica16.render(fx_modes[i], False, color_primary)
|
||||||
|
screen.blit(fx_mode_label, (x+20, y-8))
|
||||||
|
else:
|
||||||
|
draw_lozi(x, y, color_primary, True)
|
||||||
|
fx_mode_label = font_helvetica16.render(str(fx_modes[i])[0:1], False, color_primary)
|
||||||
|
screen.blit(fx_mode_label, (x-4, y-7))
|
||||||
|
"""
|
||||||
|
for i in range(7):
|
||||||
|
pygame.draw.rect(screen, color_primary, ((screenW * 1.5 / 19 + 10, i * (screenH-20)/7 + 10), (screenW * 1.5 / 19 - 10 , (screenH-20)/7 - 10)))
|
||||||
|
"""
|
||||||
|
|
||||||
|
pygame.draw.polygon(screen, "black", [(0, screenH/2), (screenW*3 / 19, screenH), (0, screenH)], 20)
|
||||||
|
pygame.draw.polygon(screen, "white", [(0, screenH/2), (screenW*3 / 19, screenH), (0, screenH)])
|
||||||
# flip() the display to put your work on screen
|
# flip() the display to put your work on screen
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user