示例#1
0
 def on_window_resize(self, width, height):
     self.screen_resolution = width, height
     if self.child_window:
         inner_area_rect = get_inner_area_rect(self.screen_resolution)
         self.viewport.x1, self.viewport.y1 = inner_area_rect[:2]
         self.viewport.x2 = self.viewport.x1 + inner_area_rect[2]
         self.viewport.y2 = self.viewport.y1 + inner_area_rect[3]
     else:
         self.viewport.x1, self.viewport.y1 = 0, 0
         self.viewport.x2, self.viewport.y2 = self.screen_resolution
示例#2
0
 def on_window_resize(self, width, height):
     self.screen_resolution = width, height
     bottom_bar_height = get_bottom_bar_height(self.screen_resolution)
     general_cells_width = get_inner_area_rect(
         self.screen_resolution)[2] - bottom_bar_height // 4
     self.viewport.x1 \
         = self.parent_viewport.x1 + bottom_bar_height // 8 + general_cells_width // 160 \
         + int((self.stage_number - 1) / 4 * (general_cells_width - general_cells_width // 80))
     self.viewport.y1 = self.parent_viewport.y1 + bottom_bar_height // 8
     self.viewport.x2 = self.viewport.x1 + (general_cells_width -
                                            general_cells_width // 80) // 4
     self.viewport.y2 = self.viewport.y1 + 3 * bottom_bar_height - bottom_bar_height // 8
示例#3
0
    def on_window_resize(self, width, height):
        self.screen_resolution = width, height
        bottom_bar_height = get_bottom_bar_height(self.screen_resolution)
        inner_area_rect = get_inner_area_rect(self.screen_resolution)
        self.viewport.x1 \
            = inner_area_rect[0] + self.construction_type * (int(6.875 * bottom_bar_height) + bottom_bar_height // 4)
        self.viewport.x2 = self.viewport.x1 + int(6.875 * bottom_bar_height)
        if self.construction_type == TRACKS:
            self.viewport.y1 = inner_area_rect[1] \
                               + (CONSTRUCTOR_VIEW_TRACK_CELLS - 1 - self.row) \
                               * (bottom_bar_height + bottom_bar_height // 4)
        elif self.construction_type == ENVIRONMENT:
            self.viewport.y1 = inner_area_rect[1] \
                               + (CONSTRUCTOR_VIEW_ENVIRONMENT_CELLS - 1 - self.row) \
                               * (bottom_bar_height + bottom_bar_height // 4)

        self.viewport.y2 = self.viewport.y1 + bottom_bar_height
 def get_font_size(self):
     return (get_inner_area_rect(self.screen_resolution)[3] // (SCHEDULE_ROWS + 1)) // 5 * 3
 def get_y(self):
     return self.parent_viewport.y1 + get_inner_area_rect(self.screen_resolution)[1] \
            + get_inner_area_rect(self.screen_resolution)[3] \
            - (get_inner_area_rect(self.screen_resolution)[3] // (SCHEDULE_ROWS + 1)) // 2
 def get_x(self):
     return self.parent_viewport.x1 + + get_inner_area_rect(self.screen_resolution)[0] \
            + int(6.875 * get_bottom_bar_height(self.screen_resolution)) // 2