|
|
|
@ -900,6 +900,22 @@ class Tony(Sprite):
|
|
|
|
|
self.location.centerx = dsr.centerx
|
|
|
|
|
self.board.location.centerx = self.location.centerx
|
|
|
|
|
|
|
|
|
|
# Add a QR code to the t-shirt
|
|
|
|
|
self.qr = Sprite(self)
|
|
|
|
|
frame = pygame.image.load(self.get_resource("qr/qr.png"))
|
|
|
|
|
frame = pygame.transform.smoothscale(frame, (165, 141))
|
|
|
|
|
self.qr.add_frame(frame)
|
|
|
|
|
self.qr.location.midtop = 410, 103
|
|
|
|
|
self.qr_text = Sprite(self, [6000, 1500, 1500, 1500, 1500])
|
|
|
|
|
if self.get_configuration("display", "qr-static"):
|
|
|
|
|
frames = load_frames(self.get_resource("qr/qr_text_static.png"), transparency=True)
|
|
|
|
|
else:
|
|
|
|
|
frames = load_frames(self.get_resource("qr/"), query="qr_text_[0-9].png", transparency=True)
|
|
|
|
|
for ii, frame in enumerate(frames):
|
|
|
|
|
frames[ii] = pygame.transform.smoothscale(frame, (165, int(165 / frame.get_width() * frame.get_height())))
|
|
|
|
|
self.qr_text.add_frames(frames)
|
|
|
|
|
self.qr_text.location.midtop = self.qr.location.midbottom
|
|
|
|
|
|
|
|
|
|
def set_frameset(self, name):
|
|
|
|
|
Sprite.set_frameset(self, name)
|
|
|
|
|
self.get_current_frameset().reset()
|
|
|
|
@ -928,11 +944,17 @@ class Tony(Sprite):
|
|
|
|
|
save = self.get_display_surface()
|
|
|
|
|
intermediate_surface = Surface(self.location.size, SRCALPHA)
|
|
|
|
|
self.display_surface = intermediate_surface
|
|
|
|
|
self.qr.display_surface = intermediate_surface
|
|
|
|
|
self.qr_text.display_surface = intermediate_surface
|
|
|
|
|
location_save = self.location.copy()
|
|
|
|
|
self.location.topleft = 0, 0
|
|
|
|
|
self.qr.location.centerx = self.location.centerx + 10
|
|
|
|
|
self.qr_text.location.midtop = self.qr.location.midbottom
|
|
|
|
|
|
|
|
|
|
# Do a regular Sprite animation update
|
|
|
|
|
Sprite.update(self)
|
|
|
|
|
self.qr.update()
|
|
|
|
|
self.qr_text.update()
|
|
|
|
|
|
|
|
|
|
# Blend the effect frame with the sprite frame
|
|
|
|
|
if not self.get_configuration("system", "minimize-load-time"):
|
|
|
|
|