Ejemplo n.º 1
0
 def test_renderer_set_viewport(self):
     """works."""
     window = video.Window(title=self.default_caption, size=(800, 600))
     renderer = video.Renderer(window=window)
     renderer.logical_size = (1920, 1080)
     rect = pygame.Rect(0, 0, 1920, 1080)
     renderer.set_viewport(rect)
     self.assertEqual(renderer.get_viewport(), (0, 0, 1920, 1080))
Ejemplo n.º 2
0
 def __init__(self):
     pg.init()
     
     self.WINDOWWIDTH, self.WINDOWHEIGHT = WINDOWWIDTH, WINDOWHEIGHT
     self.BGCOLOR = (0, 0, 0, 0)
     self.Window = video.Window(size=(WINDOWWIDTH, WINDOWHEIGHT))
     self.Renderer = video.Renderer(window = self.Window, vsync = True, target_texture = True)
     self.Renderer.draw_color = self.BGCOLOR
     self.Scene = None
     self.Audio = System.Audio
     self.Audio.init()
     self.Events = []
     self.Font = ft.Font("Fonts/NotoSansCJKtc-Regular.otf", 14)
     self.FontLarge = ft.Font("Fonts/NotoSansCJKtc-Regular.otf", 32)