From 2369def5479cbd32495fea9d2b52b1cda6139f79 Mon Sep 17 00:00:00 2001 From: frank Date: Wed, 2 Nov 2022 23:34:57 -0400 Subject: [PATCH] temporarily adjust tony shirt glow effect --- NS.py | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/NS.py b/NS.py index a5724a6..8b1a13b 100644 --- a/NS.py +++ b/NS.py @@ -787,10 +787,13 @@ class Tony(Sprite): # Create a glowing effect object by adding glow frames to a blank Sprite. It can then be applied to the main Tony Sprite frame # using `pygame.BLEND_RGBA_SUB`. Skip this if fast load is requested. if not self.get_configuration("system", "minimize-load-time"): - self.effect = Sprite(self) + # self.effect = Sprite(self) + self.effect = Sprite(self, 120) for offset in range(12): - w, h = dsr.w + 40, int(dsr.h * .65) - glow = Surface((w, h), SRCALPHA) + # w, h = dsr.w - 40, int(dsr.h * .65) + w, h = dsr.w - 120, int(dsr.h * .65) + # glow = Surface((w, h), SRCALPHA) + glow = Surface((w, h)) for ii, y in enumerate(range(h, 0, -8)): hue = range(240, 200, -2)[(ii - offset) % 12] alpha = min(100, int(round(y / float(h - 10) * 100))) @@ -800,7 +803,8 @@ class Tony(Sprite): ellipse(glow, w // 2, y, w // 2 - 4, h // 20, color) filled_ellipse(glow, w // 2, y, w // 2 - 4, h // 20, color) self.effect.add_frame(glow) - self.effect.location.topleft = -20, int(dsr.h * .35) + # self.effect.location.topleft = -20, int(dsr.h * .35) + self.effect.location.midbottom = dsr.midbottom self.add_frame(load(self.get_resource("Big_Tony.png")).convert_alpha()) self.load_from_path(self.get_resource("newTony/TonyShirtHead"), True) @@ -837,23 +841,24 @@ class Tony(Sprite): effects are off. Update title screen objects. Update the board sub-animation if it is active. """ # Create an intermediate surface for blending the glow with the sprite frame - if self.get_configuration("display", "effects"): - save = self.get_display_surface() - intermediate_surface = Surface(self.location.size, SRCALPHA) - self.display_surface = intermediate_surface - location_save = self.location.copy() - self.location.topleft = 0, 0 + # if self.get_configuration("display", "effects"): + # save = self.get_display_surface() + # intermediate_surface = Surface(self.location.size, SRCALPHA) + # self.display_surface = intermediate_surface + # location_save = self.location.copy() + # self.location.topleft = 0, 0 # Do a regular Sprite animation update Sprite.update(self) + self.effect.update(flags=BLEND_RGBA_SUB) # Blend the effect frame with the sprite frame - if self.get_configuration("display", "effects"): - self.display_surface = save - self.location = location_save - self.effect.display_surface = intermediate_surface - self.effect.update(flags=BLEND_RGBA_SUB) - self.get_display_surface().blit(intermediate_surface, self.location.topleft) + # if self.get_configuration("display", "effects"): + # self.display_surface = save + # self.location = location_save + # self.effect.display_surface = intermediate_surface + # self.effect.update(flags=BLEND_RGBA_SUB) + # self.get_display_surface().blit(intermediate_surface, self.location.topleft) # Update title screen objects that are drawn over this sprite if self.get_game().title.active: