Esempio n. 1
0
 def draw_item(self, surf, i, rect):
     plant = game.get_specimen_no(i)
     thumb = get_plant_thumbnail(plant, self.thumb_size)
     r = thumb.get_rect()
     r.center = rect.center
     surf.fill(self.thumbnail_bg_color, r)
     surf.blit(thumb, r)
     frame_rect(surf, self.frame_color, r, self.thumbnail_border_width)
     r = rect.inflate(-2, -2)
     buf = self.font.render(str(plant.number), True, self.text_color,
                            self.text_bg_color)
     r = buf.get_rect()
     blit_in_rect(surf, buf, rect, 'bl', 3)
Esempio n. 2
0
	def draw_item(self, surf, i, rect):
		plant = game.get_specimen_no(i)
		thumb = get_plant_thumbnail(plant, self.thumb_size)
		r = thumb.get_rect()
		r.center = rect.center
		surf.fill(self.thumbnail_bg_color, r)
		surf.blit(thumb, r)
		frame_rect(surf, self.frame_color, r, self.thumbnail_border_width)
		r = rect.inflate(-2, -2)
		buf = self.font.render(str(plant.number), True, self.text_color,
			self.text_bg_color)
		r = buf.get_rect()
		blit_in_rect(surf, buf, rect, 'bl', 3)
Esempio n. 3
0
 def draw(self, surf):
     #print "PlantView.draw" ###
     plant = self.ref.get()
     if plant:
         buffer = render_plant(plant, self.size)
         frame = surf.get_rect()
         r = buffer.get_rect()
         r.midbottom = frame.midbottom
         surf.blit(buffer, r)
         title = plant.get_description()
         buf = self.font.render(title, True, self.text_color)
         r = buf.get_rect()
         blit_in_rect(surf, buf, frame, 'bl', 3)
Esempio n. 4
0
	def draw(self, surf):
		#print "PlantView.draw" ###
		plant = self.ref.get()
		if plant:
			buffer = render_plant(plant, self.size)
			frame = surf.get_rect()
			r = buffer.get_rect()
			r.midbottom = frame.midbottom
			surf.blit(buffer, r)
			title = plant.get_description()
			buf = self.font.render(title, True, self.text_color)
			r = buf.get_rect()
			blit_in_rect(surf, buf, frame, 'bl', 3)