def draw_in_buffer(self): #console.move_cursor(self.x,self.y); #print(self.style); if self.x >= 0 and self.y >= 0 and self.x < console.get_max_width( ) and self.y < console.get_max_height() - 1: console.move_buffer_cursor(int(self.x), int(self.y)) console.add_str(self.style, self.forecolor, self.backcolor)
def draw_in_buffer_need_camera(self, camera: Camera): will_x = int(self.x) - int(camera.look_x) + int( console.get_max_width() / 2) will_y = int(self.y) - int(camera.look_y) + int( console.get_max_height() / 2) console.move_buffer_cursor(int(will_x), int(will_y)) console.add_str(self._style)
def draw_in_buffer_need_camera(self, camera: Camera): will_x = int(self.x) - int(camera.look_x) + int( console.get_max_width() / 2) will_y = int(self.y) - int(camera.look_y) + int( console.get_max_height() / 2) if will_x >= 0 and will_y >= 0 and will_x < console.get_max_width( ) and will_y < console.get_max_height() - 1: console.move_buffer_cursor(int(will_x), int(will_y)) console.add_str(self.style, self.forecolor, self.backcolor)
def game_draw_information(ch): if ch > 0: console.move_buffer_cursor(0, 0) console.add_str("按下的按键:" + str(chr(ch))) console.move_buffer_cursor(0, 1) console.add_str("ASCII码值:" + str(ch)) console.move_buffer_cursor(20, 0) console.add_str("玩家名字:" + str(player1.name)) console.move_buffer_cursor(20, 1) console.add_str("玩家HP:" + str(player1.hp)) console.move_buffer_cursor(20, 2) console.add_str("玩家X:" + str(player1.x) + " 玩家Y:" + str(player1.y))
def main(stdscr): game.game_init(); game.game_start(); console.add_str("dawdawd\n"); console.add_str(str(console.get_cursor_x()) + "\n"); console.add_str(str(console.get_cursor_y()) + "\n");
def draw_information(self): console.move_buffer_cursor(0, 4) console.add_str("TypeName:" + str(self.type_name)) console.move_buffer_cursor(0, 5) console.add_str("TypeCollision:" + str(self.collision)) console.move_buffer_cursor(0, 6) console.add_str("TypeStyle:" + str(self.style)) console.move_buffer_cursor(0, 7) console.add_str("TypeForegroundColor:" + str(self.forecolor)) console.move_buffer_cursor(0, 8) console.add_str("TypeBackgroundColor:" + str(self.backcolor)) console.move_buffer_cursor(0, 9) console.add_str("X:" + str(self.x)) console.move_buffer_cursor(0, 10) console.add_str("Y:" + str(self.y)) console.move_buffer_cursor(0, 11) console.add_str("Width:" + str(self.width)) console.move_buffer_cursor(0, 12) console.add_str("Height:" + str(self.height))
def draw_in_buffer(self): #console.move_cursor(self.x,self.y); #print(self._style); console.move_buffer_cursor(int(self.x), int(self.y)) console.add_str(self._style)