def draw(self, display): if self.hud_open: tools.blit_alpha(display, self.background.image, self.background.rect.topleft, 128) [component.draw(display) for component in self.components]
def draw(self, display): if self.opacity == 255: display.blit(self.image, (self.rect.x, self.rect.y)) elif self.opacity == 0: return else: tools.blit_alpha(display, self.image, self.rect.topleft, self.opacity)
def draw(self, display): for particle in self.particles: particle.draw(display) for particle in self.fade_out_particles: tools.blit_alpha(display, particle.image, particle.rect.topleft, particle.image.get_alpha()) for particle in self.fade_in_particles: tools.blit_alpha(display, particle.image, particle.rect.topleft, particle.image.get_alpha())
def draw(self, display): # Takes a group of tile sprites # and draws them to the display layered_render = [] for chunk in self.live_chunks: chunk_to_draw = self.map_tiles[chunk] chunk_to_draw.draw(display) for dec in chunk_to_draw.get_decs(): if dec.tile_code in src.terrain.tile_types.no_layer_decs: dec.draw(display) else: layered_render.append(dec) [ layered_render.append(entity) for entity in chunk_to_draw.get_entities() ] [layered_render.append(bean) for bean in self.player.beans] for dec in sorted(layered_render, key=lambda x: x.shadow.rect.bottom if x.has_shadow else x.rect.bottom): if dec.__class__.__name__ not in constants.no_fade_sprites: if dec.tile_code not in no_fade_decs: if any([ dec.rect.colliderect(bean.rect) for bean in self.player.beans ]): if dec.has_shadow: dec.shadow.draw(display) tools.blit_alpha(display, dec.image, dec.rect.topleft, 180) else: dec.draw(display) else: dec.draw(display) else: dec.draw(display) [entity.draw(display) for entity in self.assorted_entities] self.master.particle_engine.draw(display) if self.hud_on: self.hud.draw(display) if self.hud.get_component("backing").hud_open: [panel.draw(display) for panel in self.other_bean_stat_panels]