コード例 #1
0
ファイル: cursor.py プロジェクト: efunn/rtfmri-trainer
 def draw(self): 
     if self.dof == 1:
         gg.draw_center_rect(self.screen, 2*(self.RAD+self.OUTLINE_THK), 2*self.screen_mid[1],
                             self.OUTLINE_COLOR, self.pos[0], self.screen_mid[1])
         gg.draw_center_rect(self.screen, 2*self.RAD, 2*self.screen_mid[1],
                             self.color, self.pos[0], self.screen_mid[1])
     elif self.dof == 2:
         gg.draw_filled_aacircle(self.screen, self.RAD+self.OUTLINE_THK, self.OUTLINE_COLOR,
                                 self.pos[0], self.pos[1])
         gg.draw_filled_aacircle(self.screen, self.RAD, self.color,
                                 self.pos[0], self.pos[1])
コード例 #2
0
ファイル: trainer.py プロジェクト: efunn/rtfmri-trainer
 def draw_indicator(self):
     if self.dof == 1:
         gg.draw_center_rect(self.screen,
                             2*self.indicator_rad, self.SCREEN_HEIGHT,
                             self.indicator_color,
                             self.START_COORDS[0], self.screen_mid[1])
     elif self.dof == 2:
         gg.draw_filled_aacircle(self.screen,
                                 self.indicator_rad,
                                 self.indicator_color,
                                 self.START_COORDS[0], self.START_COORDS[1])
コード例 #3
0
ファイル: target.py プロジェクト: efunn/rtfmri-trainer
 def draw(self):
     if self.draw_bool:
         if self.dof == 1:
             gg.draw_center_rect(self.screen, 2*(self.rad+self.outline_rad), 2*self.screen_mid[1],
                                 self.outline_color, self.pos[0], self.screen_mid[1])
             gg.draw_center_rect(self.screen, 2*self.rad, 2*self.screen_mid[1],
                                 self.color, self.pos[0], self.screen_mid[1])
         elif self.dof == 2:
             gg.draw_filled_aacircle(self.screen, self.rad+self.outline_rad, self.outline_color,
                                     self.pos[0], self.pos[1])
             gg.draw_filled_aacircle(self.screen, self.rad, self.color,
                                     self.pos[0], self.pos[1])
コード例 #4
0
ファイル: target.py プロジェクト: efunn/hemo-control
 def draw(self, draw_type):
     if draw_type == 'next_next':
         self.color = self.NEXT_NEXT_COLOR
     elif draw_type == 'next':
         self.color = self.NEXT_COLOR
     elif draw_type == 'current':
         if self.highlight:
             if self.success:
                 self.color = self.HIGHLIGHT_COLOR
             else:
                 self.color = self.HIGHLIGHT_COLOR_FAIL
         elif self.wait_prev_target:
             self.color = self.CURRENT_COLOR
         else:
             self.color = self.CURRENT_COLOR_ACTIVE
     gg.draw_filled_aacircle(self.screen, self.rad, self.color,
                             self.pos[0], self.pos[1])
コード例 #5
0
ファイル: template_game.py プロジェクト: efunn/sequence-learn
 def draw_keyboard(self):
     for key in range(5):
         if game.keydown[key]:
             color = game.ACTIVE_COLOR
         else:
             color = game.PASSIVE_COLOR
         gg.draw_center_rect(self.screen,
                             self.KEY_WIDTH,
                             self.KEY_HEIGHT,
                             color,
                             .5*self.SCREEN_WIDTH+self.KEY_XPOS*(key-2),
                             self.KEY_YPOS)
         if (game.current_key != 'none'
                 and game.current_key != game.last_key):
             gg.draw_filled_aacircle(self.screen, .5*self.KEY_WIDTH,
                                     self.ACTIVE_COLOR,
                                     .5*self.SCREEN_WIDTH+self.KEY_XPOS*(game.current_key-2),
                                     .6*self.KEY_YPOS)
             game.potential_last_key = game.current_key
         else:
             game.last_key = game.potential_last_key
コード例 #6
0
ファイル: trainer.py プロジェクト: efunn/rtfmri-trainer
    def draw_play_area(self):
        if self.dof == 1:
            gg.draw_center_rect(self.screen,
                                self.SCREEN_HEIGHT, self.SCREEN_HEIGHT,
                                self.bg_color,
                                self.screen_mid[0], self.screen_mid[1])

            gg.draw_center_rect(self.screen, 
                                self.TARGET_DIST[1]-self.TARGET_DIST[0],
                                self.SCREEN_HEIGHT,
                                self.bg_color_alt,
                                (self.TARGET_DIST[0]
                                 +0.5*(self.TARGET_DIST[1]
                                       -self.TARGET_DIST[0])
                                 + self.START_COORDS[0]),
                                self.screen_mid[1])

            gg.draw_center_rect(self.screen,
                                2*(self.START_DIST-self.cursor.RAD),
                                self.SCREEN_HEIGHT,
                                self.bg_color_alt_2,
                                self.START_COORDS[0],  self.screen_mid[1])

        elif self.dof == 2:
            gg.draw_center_rect(self.screen,
                                self.SCREEN_HEIGHT, self.SCREEN_HEIGHT,
                                self.bg_color,
                                self.screen_mid[0], self.screen_mid[1])

            gg.draw_filled_aacircle(self.screen,
                                    self.TARGET_DIST[1],
                                    self.bg_color_alt,
                                    self.START_COORDS[0], self.START_COORDS[1])

            gg.draw_filled_aacircle(self.screen,
                                    self.TARGET_DIST[0],
                                    self.bg_color,
                                    self.START_COORDS[0], self.START_COORDS[1])

            gg.draw_center_rect(self.screen,
                                self.SCREEN_HEIGHT, 2*self.BUFFER_DIST,
                                self.bg_color,
                                self.screen_mid[0], self.GAME_ORIGIN[1])
            gg.draw_center_rect(self.screen,
                                2*self.BUFFER_DIST, self.SCREEN_HEIGHT,
                                self.bg_color,
                                self.GAME_ORIGIN[0], self.screen_mid[1])

            gg.draw_filled_aacircle(self.screen,
                                    self.START_DIST-self.cursor.RAD,
                                    self.bg_color_alt_2,
                                    self.START_COORDS[0], self.START_COORDS[1])