diff --git a/NS.py b/NS.py index 8ac3ea0..5b074dc 100644 --- a/NS.py +++ b/NS.py @@ -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"): diff --git a/config b/config index 015aa2c..99a9e4a 100644 --- a/config +++ b/config @@ -28,8 +28,9 @@ dimensions = 800, 450 fullscreen = no attract-gif-alpha = 1.0 effects = True -alpha-effect-title = False +alpha-effect-title = True scores-font = BPmono.ttf +qr-static = True [system] # will force set display->effects to off diff --git a/lib/pgfw b/lib/pgfw index 9c9926d..2bbdc9a 160000 --- a/lib/pgfw +++ b/lib/pgfw @@ -1 +1 @@ -Subproject commit 9c9926d9e04a15cf3612d0594a5e19e79682a619 +Subproject commit 2bbdc9a7028dd86c8a2f06a74403ffc5a1fe6d44 diff --git a/resource/qr/qr.png b/resource/qr/qr.png new file mode 100644 index 0000000..236b489 Binary files /dev/null and b/resource/qr/qr.png differ diff --git a/resource/qr/qr_static_with_url.png b/resource/qr/qr_static_with_url.png new file mode 100644 index 0000000..3fa2da7 Binary files /dev/null and b/resource/qr/qr_static_with_url.png differ diff --git a/resource/qr/qr_text_0.png b/resource/qr/qr_text_0.png new file mode 100644 index 0000000..44f241c Binary files /dev/null and b/resource/qr/qr_text_0.png differ diff --git a/resource/qr/qr_text_1.png b/resource/qr/qr_text_1.png new file mode 100644 index 0000000..94b0bc3 Binary files /dev/null and b/resource/qr/qr_text_1.png differ diff --git a/resource/qr/qr_text_2.png b/resource/qr/qr_text_2.png new file mode 100644 index 0000000..a2252f3 Binary files /dev/null and b/resource/qr/qr_text_2.png differ diff --git a/resource/qr/qr_text_3.png b/resource/qr/qr_text_3.png new file mode 100644 index 0000000..bbdbd12 Binary files /dev/null and b/resource/qr/qr_text_3.png differ diff --git a/resource/qr/qr_text_4.png b/resource/qr/qr_text_4.png new file mode 100644 index 0000000..7d6ff8a Binary files /dev/null and b/resource/qr/qr_text_4.png differ diff --git a/resource/qr/qr_text_static.png b/resource/qr/qr_text_static.png new file mode 100644 index 0000000..44f241c Binary files /dev/null and b/resource/qr/qr_text_static.png differ diff --git a/www/index.php b/www/index.php index 56792f0..2293e5a 100644 --- a/www/index.php +++ b/www/index.php @@ -75,6 +75,79 @@ + + + +