def render(self,draw_menu_rect=True): if my_state.view: my_state.view() self.bottom_sprite.tile(pygame.Rect(0,my_state.screen.get_height()//2+100,my_state.screen.get_width(),200)) if self.npc_sprite: self.npc_sprite.render(self.get_portrait_area()) if self.pilot_sprite: default_border.render(self.PILOT_AREA.get_rect()) self.pilot_sprite.render(self.PILOT_AREA.get_rect(),1) text_rect = self.TEXT_AREA.get_rect() default_border.render(text_rect) draw_text(my_state.medium_font,self.text,text_rect) if draw_menu_rect: default_border.render(self.MENU_AREA.get_rect()) name_rect = self.NAME_AREA.get_rect() default_border.render(name_rect) draw_text(my_state.big_font,str(self.npc),name_rect,color=pbge.WHITE,justify=0) name_rect.y += my_state.big_font.get_linesize() draw_text(my_state.small_font,self.npc_desc,name_rect,color=pbge.GREY,justify=0) if self.pc: react_level = ( self.npc.get_reaction_score(self.pc,self.camp) + 99 )//40 self.react_sprite.render(self.REACT_AREA.get_rect(),react_level)
def rollout(self): bx = my_state.screen.get_width() t = 0 myrect = self.PORTRAIT_AREA.get_rect() myrect.x = -400 while (myrect.x < self.get_portrait_area().x): if my_state.view: my_state.view() self.bottom_sprite.tile(pygame.Rect(max(0,bx-t*75),my_state.screen.get_height()//2+100,my_state.screen.get_width(),200)) if self.npc_sprite: self.npc_sprite.render(myrect) my_state.do_flip() myrect.x += 25 anim_delay() t += 1
def render(self,draw_menu_rect=True): if my_state.view: my_state.view() self.bottom_sprite.tile(pygame.Rect(0,my_state.screen.get_height()//2+100,my_state.screen.get_width(),200)) if self.npc_sprite: self.npc_sprite.render(self.get_portrait_area()) if self.pilot_sprite: default_border.render(self.PILOT_AREA.get_rect()) self.pilot_sprite.render(self.PILOT_AREA.get_rect(),1) text_rect = self.TEXT_AREA.get_rect() default_border.render(text_rect) draw_text(my_state.medium_font,self.text,text_rect) if draw_menu_rect: default_border.render(self.MENU_AREA.get_rect())