Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- from multiprocessing import Process
- lines = [chr(i) for i in range(33, 255)]
- def main():
- from pathlib import Path
- path = '/'.join(str(__file__).split('/')[:-2])
- pygame.init()
- size = (700, 500)
- screen = pygame.display.set_mode(size, pygame.RESIZABLE)
- pygame.display.set_caption("PyTerm")
- run = True
- roboto = pygame.font.SysFont('FixedSys', 15)
- h = 500
- w = 700
- lines = [chr(i) for i in range(33, 255)]
- line = 0
- def CreateWindow(width, height):
- global screen, h, w
- '''Updates the window width and height '''
- screen = pygame.display.set_mode((width, height), pygame.RESIZABLE)
- h = height
- w = width
- screen.fill((0, 0, 0))
- d = pygame.Surface((700, 700))
- while run:
- pygame.time.delay(10)
- screen.fill((0, 0, 0))
- for i in range(len(lines) - line):
- screen.blit(roboto.render(lines[i + line], True, pygame.Color('#ffffff')), (10, i * 15 + 10))
- pygame.display.update()
- for e in pygame.event.get():
- if e.type == pygame.QUIT:
- run = False
- elif e.type == pygame.VIDEORESIZE:
- CreateWindow(e.w, e.h)
- if e.type == pygame.MOUSEBUTTONDOWN:
- if e.button == 5 and line < len(lines) - 1:
- line += 2
- elif e.button == 4 and line > 0:
- line -= 2
- pygame.quit()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement