コード例 #1
0
ファイル: panel.py プロジェクト: pombredanne/Obb
    def draw(self):
        for j, (age, appspec, (cx, cy)) in enumerate(zip(self.ages, self.tiles, self.centers)):
            color = "app%s" % int(j / 2)
            if age < -1:
                img = graphics.loadbar(1 - ((-age - 1) / 5), color)
                rect = img.get_rect(center=(cx, cy))
            else:
                img = graphics.drawpaneltile(appspec.dedges, color, tilt=age * 450)
                if self.selected == j:
                    img = graphics.brighten(img)
                    # pygame.draw.circle(vista.psurf, (255, 255, 255), self.centers[self.selected], settings.layout.ptilesize, 2)
                rect = img.get_rect(center=(cx + age * 300, cy))
            vista.psurf.blit(img, rect)

            # Draw cube tally
        color, size = (0, 0, 0), settings.layout.countsize
        img = font.img("%s" % (self.body.ncubes), size=size, color=color)
        vista.psurf.blit(self.cubeimg, self.cuberect)
        self.ncuberect = img.get_rect(midleft=self.cuberect.midright)
        vista.psurf.blit(img, self.ncuberect)
コード例 #2
0
ファイル: panels.py プロジェクト: pombredanne/Obb
def drawtiles():
	loadrate = status.state.tileloadrate
	for j in range(mechanics.ntiles):
		tiletime = status.state.tiletimes[j]
		color = "app" + str(mechanics.tilecolors[j])
		appspec = status.state.tiles[j]
		cx, cy = tilepos(j)
		if tiletime <= 0:  # Draw it in its normal place
			img = graphics.drawpaneltile(appspec.dedges, color)
			if j == selectedtile:
				img = graphics.brighten(img)
		elif tiletime <= loadrate:  # Draw it rolling in from the left
			frac = float(tiletime) / loadrate
			cx -= int(frac * settings.layout.tilerollx)
			img = graphics.drawpaneltile(appspec.dedges, color, tilt = -450 * frac)
		else:  # Draw the progress bar
			part = float(mechanics.tileloadtime - tiletime)
			full = float(mechanics.tileloadtime - loadrate)
			assert 0 <= part <= full
			img = graphics.loadbar(part / full if full else 0, color)
		rect = img.get_rect(center = (cx, cy))
		vista.psurf.blit(img, rect)
コード例 #3
0
ファイル: panel.py プロジェクト: wolmir/cristina
    def draw(self):
        for j, (age, appspec,
                (cx, cy)) in enumerate(zip(self.ages, self.tiles,
                                           self.centers)):
            color = "app%s" % int(j / 2)
            if age < -1:
                img = graphics.loadbar(1 - ((-age - 1) / 5), color)
                rect = img.get_rect(center=(cx, cy))
            else:
                img = graphics.drawpaneltile(appspec.dedges,
                                             color,
                                             tilt=age * 450)
                if self.selected == j:
                    img = graphics.brighten(img)
#                    pygame.draw.circle(vista.psurf, (255, 255, 255), self.centers[self.selected], settings.layout.ptilesize, 2)
                rect = img.get_rect(center=(cx + age * 300, cy))
            vista.psurf.blit(img, rect)

        # Draw cube tally
        color, size = (0, 0, 0), settings.layout.countsize
        img = font.img("%s" % (self.body.ncubes), size=size, color=color)
        vista.psurf.blit(self.cubeimg, self.cuberect)
        self.ncuberect = img.get_rect(midleft=self.cuberect.midright)
        vista.psurf.blit(img, self.ncuberect)