Example #1
0
 def draw(self, surface):
     if self.redraw:
         sw, sh = surface.get_size()
         self.redraw = False
         self.borderFilled.draw(surface, surface.get_rect().inflate(6,6))
         rect = pygame.Rect((sw*.05, sh*.05, sw*.90, sh*.90))
         draw.drawText(surface, hints, (128, 129, 129),
                       rect.move(1,1), self.msgFont)
         draw.drawText(surface, hints, self.foreground, rect, self.msgFont)
Example #2
0
    def draw(self, surface):
        if self.redraw:
            self.redraw = False

            sw, sh = surface.get_size()

            # draw the border
            x, y = 0.0313 * sw, 0.6667 * sh
            w, h = 0.9375 * sw, 0.2917 * sh
            self.border.draw(surface, (x, y, w, h), fill=True)
           
            fullpath = res.fontPath("dpcomic.ttf")
            fontSize = int(0.0667 * sh)
            font = pygame.font.Font(fullpath, fontSize)

            # adjust the margins of text if there is a title
            if self.title:
                x = 0.0625 * sw
                y = 0.7 * sh

            draw.drawText(surface, self.text, (0,0,0), (x+10,y+8,w-18,h-12),
                         font, aa=1, bkg=self.background)
            
            # print the title
            if self.title != None:
                banner = OutlineTextBanner(self.title, (200,200,200),
                                           int(fontSize*1.25), font=self.font)
                title_image = banner.render()
                x, y = 0.4688 * sw, 0.625 * sh
                surface.blit(title_image, (x, y))

            # show arrow
            #x, y = 0.0625 * sw, 0.9167 * sh
            #arrow = res.loadImage("wait_arrow.png", colorkey=1)
            #surface.blit(arrow, (x, y))

            # play a nice sound 
            self.wait_sound.stop()
            self.wait_sound.play()