Exemple #1
0
def press_back():
    m_oJoyHandler = joystick()
    while True:
        event = m_oJoyHandler.event_wait()
        if event & CRT_CANCEL:
            m_oJoyHandler.quit()
            break
Exemple #2
0
 def _init_pygame(self):
     pygame.mixer.pre_init(44100, -16, 2, 4096)
     pygame.display.init()
     pygame.mouse.set_visible(0)
     self.m_oJoyHandler = joystick()
     self._init_screen()
     self.m_oClock = pygame.time.Clock()
     self._init_sounds()
Exemple #3
0
def pygame_initialization():
    global PGoScreen
    global PGoFont
    global PGoJoyHandler
    global PGoSndCursor
    global PGoSndClick
    pygame.mixer.pre_init(44100, -16, 1, 512)
    pygame.init()
    pygame.mouse.set_visible(0)
    PGoJoyHandler = joystick()
    PGoFont = pygame.font.Font(FONT_FILE, 8)
    PGoScreen = pygame.display.set_mode((iRES_X, iRES_Y), pygame.FULLSCREEN)
    PGoSndCursor = pygame.mixer.Sound(CURSOR_SOUND_FILE)
    PGoSndClick = pygame.mixer.Sound(CLICK_SOUND_FILE)
    def write(self, p_sText="your text", p_iMax=15):
        if not self.m_oJoyHandler:
            self.m_oJoyHandler = joystick()
            self.m_iChar = 1
            self.m_sText = p_sText
            self.m_iText_Max = p_iMax
            self.m_sText_Bck = p_sText

        if not pygame.mixer.get_init():
            self._init_sounds()

        if not self.m_oSfKBD:
            self._render_keyboard()
            return self.m_oSfKBD
        else:
            value = self._input()
            if value: return self.m_oSfKBD
            elif value == None: text = self.m_sText_Bck
            else: text = self.m_sText
            self.quit()
            return text
Exemple #5
0
 def _init_pygame(self):
     pygame.mixer.pre_init(44100, -16, 1, 512)
     pygame.init()
     self.m_PGoJoyHandler = joystick()
     self._init_screen()
     self._init_sounds()