Beispiel #1
0
	def redraw(self):
		SURFACE_WIDTH = 200
		SURFACE_HEIGHT = 200
		oldAlpha = self.image.get_alpha()

		self.imageMaster = pygame.surface.Surface( (SURFACE_WIDTH, SURFACE_HEIGHT) )
		self.imageMaster.fill((255,0,255))
		image = get_image("sun.png").convert()
		image.set_colorkey((255,0,255))
		blit_tinted( self.imageMaster, image, (0,0), (self.color.r, self.color.g, self.color.b ) )

		#outline = get_image("sun_outline.png").convert()
		#outline.set_colorkey((255,0,255))
		#self.imageMaster.blit( outline, (0,0))
		#pygame.draw.circle(self.imageMaster, self.color, (SURFACE_WIDTH/2,SURFACE_HEIGHT/2), SURFACE_WIDTH/2 )
		#self.imageMaster.set_colorkey((255,0,255))

		#self.imageMaster = pygame.surface.Surface( (SURFACE_WIDTH, SURFACE_HEIGHT) )
		#pygame.draw.circle(self.imageMaster, self.color, (SURFACE_WIDTH/2,SURFACE_HEIGHT/2), SURFACE_WIDTH/2 )
		self.imageMaster.set_colorkey((255,0,255))

		self.image = self.imageMaster

		pos = self.rect.center
		self.rect = self.image.get_rect()
		self.rect.center = pos

		self.image.set_alpha(oldAlpha)
Beispiel #2
0
    def redraw(self):
        SURFACE_WIDTH = 200
        SURFACE_HEIGHT = 200
        oldAlpha = self.image.get_alpha()

        self.imageMaster = pygame.surface.Surface(
            (SURFACE_WIDTH, SURFACE_HEIGHT))
        self.imageMaster.fill((255, 0, 255))
        image = get_image("sun.png").convert()
        image.set_colorkey((255, 0, 255))
        blit_tinted(self.imageMaster, image, (0, 0),
                    (self.color.r, self.color.g, self.color.b))

        #outline = get_image("sun_outline.png").convert()
        #outline.set_colorkey((255,0,255))
        #self.imageMaster.blit( outline, (0,0))
        #pygame.draw.circle(self.imageMaster, self.color, (SURFACE_WIDTH/2,SURFACE_HEIGHT/2), SURFACE_WIDTH/2 )
        #self.imageMaster.set_colorkey((255,0,255))

        #self.imageMaster = pygame.surface.Surface( (SURFACE_WIDTH, SURFACE_HEIGHT) )
        #pygame.draw.circle(self.imageMaster, self.color, (SURFACE_WIDTH/2,SURFACE_HEIGHT/2), SURFACE_WIDTH/2 )
        self.imageMaster.set_colorkey((255, 0, 255))

        self.image = self.imageMaster

        pos = self.rect.center
        self.rect = self.image.get_rect()
        self.rect.center = pos

        self.image.set_alpha(oldAlpha)
Beispiel #3
0
    def getIcon(self):
        self.iconSize = 50
        SURFACE_WIDTH = self.iconSize
        SURFACE_HEIGHT = self.iconSize
        icon = pygame.Surface((SURFACE_WIDTH, SURFACE_HEIGHT))
        icon.fill((255, 255, 255))

        if self.weather.isSun:
            self.imageMaster = pygame.surface.Surface(
                (SURFACE_WIDTH, SURFACE_HEIGHT))
            self.imageMaster.fill((255, 0, 255))
            image = get_image("sun_icon.png").convert()
            image.set_colorkey((255, 0, 255))
            blit_tinted(self.imageMaster, image, (0, 0),
                        (self.color.r, self.color.g, self.color.b))

            self.imageMaster.set_colorkey((255, 0, 255))

            icon = self.imageMaster

            return icon

            #pygame.draw.circle( icon,
            #                    self.color,
            #                    (SURFACE_WIDTH/2,SURFACE_HEIGHT/2),
            #                    SURFACE_HEIGHT/2)
        else:
            self.imageMaster = pygame.surface.Surface(
                (SURFACE_WIDTH, SURFACE_HEIGHT))
            self.imageMaster.fill((255, 0, 255))
            image = get_image("cloud_icon.png").convert()
            image.set_colorkey((255, 0, 255))
            blit_tinted(self.imageMaster, image, (0, 0),
                        (self.color.r, self.color.g, self.color.b))

            self.imageMaster.set_colorkey((255, 0, 255))

            icon = self.imageMaster

            return icon
            #pygame.draw.circle( icon,
            #					(128,128,128),
            #					(SURFACE_WIDTH/2,SURFACE_HEIGHT/2),
            #					SURFACE_HEIGHT/2)

            #pygame.draw.circle( icon,
            #					self.color,
            #					(SURFACE_WIDTH/4,SURFACE_HEIGHT/4),
            #					SURFACE_HEIGHT/4)
        return icon
Beispiel #4
0
	def getIcon(self):
		self.iconSize = 50
		SURFACE_WIDTH = self.iconSize
		SURFACE_HEIGHT = self.iconSize
		icon = pygame.Surface((SURFACE_WIDTH, SURFACE_HEIGHT))
		icon.fill( (255,255,255) )

		if self.weather.isSun:
			self.imageMaster = pygame.surface.Surface( (SURFACE_WIDTH, SURFACE_HEIGHT) )
			self.imageMaster.fill((255,0,255))
			image = get_image("sun_icon.png").convert()
			image.set_colorkey((255,0,255))
			blit_tinted( self.imageMaster, image, (0,0), (self.color.r, self.color.g, self.color.b ) )

			self.imageMaster.set_colorkey((255,0,255))

			icon = self.imageMaster

			return icon

			#pygame.draw.circle( icon,
			#                    self.color,
			#                    (SURFACE_WIDTH/2,SURFACE_HEIGHT/2),
			#                    SURFACE_HEIGHT/2)
		else:
			self.imageMaster = pygame.surface.Surface( (SURFACE_WIDTH, SURFACE_HEIGHT) )
			self.imageMaster.fill((255,0,255))
			image = get_image("cloud_icon.png").convert()
			image.set_colorkey((255,0,255))
			blit_tinted( self.imageMaster, image, (0,0), (self.color.r, self.color.g, self.color.b ) )

			self.imageMaster.set_colorkey((255,0,255))

			icon = self.imageMaster

			return icon
			#pygame.draw.circle( icon,
			#					(128,128,128),
			#					(SURFACE_WIDTH/2,SURFACE_HEIGHT/2),
			#					SURFACE_HEIGHT/2)

			#pygame.draw.circle( icon,
			#					self.color,
			#					(SURFACE_WIDTH/4,SURFACE_HEIGHT/4),
			#					SURFACE_HEIGHT/4)
		return icon