コード例 #1
0
def get_screen_size_adjust():
    global iMARGIN_TOP
    global iIntLine
    global iLineAdj
    global iMARGIN_RIGHT
    global iMARGIN_LEFT
    global iRES_X
    global iRES_Y

    # Get current x,y resolution
    iRES_X, iRES_Y = get_screen_resolution()

    if iRES_Y > 270:
        Multiplier = int((iRES_Y - 270) / 8)
        iIntLine = 20 - Multiplier
        iLineAdj = int(Multiplier / 2)
        iMARGIN_TOP = 20 - ((iRES_Y - 270) - (Multiplier * 9))
    elif iRES_Y < 270:
        Multiplier = int((270 - iRES_Y) / 8)
        iIntLine = 20 - Multiplier
        iLineAdj = int(-1 * (Multiplier / 2))
        iMARGIN_TOP = 20 - ((270 - iRES_Y) - (Multiplier * 9))

    elif iRES_Y == 270:
        iMARGIN_TOP = 20
        iIntLine = 20

    if iRES_X < 340:
        iMARGIN_RIGHT = 269
        iMARGIN_LEFT = 50
    else:
        iMARGIN_RIGHT = 340
        iMARGIN_LEFT = 100
コード例 #2
0
    def _init_screen(self):
        pygame.display.init()
        pygame.font.init()
        pygame.mouse.set_visible(0)

        # gfx
        self.m_oFontText = pygame.font.Font(
            os.path.join(self.m_sSkinPath, self.dCFG['font']),
            self.dCFG['font_size'])
        self.dCFG['font_line'] = self.m_oFontText.get_linesize()

        # screen
        self.m_lResolutionXY = get_screen_resolution()
        self._side_and_size()
        self.m_oScreen = pygame.display.set_mode(self.m_lResolutionXY,
                                                 pygame.FULLSCREEN)
コード例 #3
0
 def launch(self):
     self.m_iRES_X, self.m_iRES_Y = get_screen_resolution()
     self._init_pygame()
     self.loop()
     self.save()
     self.cleanup()