diff --git a/pygame_gui/core/drawable_shapes.py b/pygame_gui/core/drawable_shapes.py index 9cc09a7a..d76ece00 100644 --- a/pygame_gui/core/drawable_shapes.py +++ b/pygame_gui/core/drawable_shapes.py @@ -258,7 +258,7 @@ def redraw_state(self, state_str): if self.theming['border_width'] > 0: if type(self.theming[border_colour_state_str]) == ColourGradient: - border_shape_surface = pygame.Surface(self.border_rect.size) + border_shape_surface = pygame.Surface(self.border_rect.size, flags=pygame.SRCALPHA) border_shape_surface.fill(pygame.Color('#FFFFFFFF')) self.surfaces[state_str].blit(border_shape_surface, self.border_rect, special_flags=pygame.BLEND_RGBA_SUB) @@ -268,7 +268,7 @@ def redraw_state(self, state_str): self.surfaces[state_str].fill(self.theming[border_colour_state_str], self.border_rect) if type(self.theming[bg_colour_state_str]) == ColourGradient: - background_shape_surface = pygame.Surface(self.background_rect.size) + background_shape_surface = pygame.Surface(self.background_rect.size, flags=pygame.SRCALPHA) background_shape_surface.fill(pygame.Color('#FFFFFFFF')) self.surfaces[state_str].blit(background_shape_surface, self.background_rect, special_flags=pygame.BLEND_RGBA_SUB) @@ -281,7 +281,7 @@ def redraw_state(self, state_str): bar_rect = pygame.Rect(self.background_rect.topleft, (self.theming['filled_bar_width'], self.background_rect.height)) if type(self.theming['filled_bar']) == ColourGradient: - bar_shape_surface = pygame.Surface(bar_rect.size) + bar_shape_surface = pygame.Surface(bar_rect.size, flags=pygame.SRCALPHA) bar_shape_surface.fill(pygame.Color('#FFFFFFFF')) self.surfaces[state_str].blit(bar_shape_surface, bar_rect, special_flags=pygame.BLEND_RGBA_SUB) self.theming['filled_bar'].apply_gradient_to_surface(bar_shape_surface) diff --git a/pygame_gui/elements/ui_screen_space_health_bar.py b/pygame_gui/elements/ui_screen_space_health_bar.py index d10a11fb..4533a083 100644 --- a/pygame_gui/elements/ui_screen_space_health_bar.py +++ b/pygame_gui/elements/ui_screen_space_health_bar.py @@ -44,7 +44,6 @@ def __init__(self, relative_rect: pygame.Rect, self.font = None self.border_width = None self.shadow_width = None - self.background_colour = None self.border_colour = None self.bar_unfilled_colour = None self.bar_filled_colour = None @@ -237,11 +236,6 @@ def rebuild_from_changed_theme_data(self): self.shadow_width = shadow_width has_any_changed = True - background_colour = self.ui_theme.get_colour_or_gradient(self.object_ids, self.element_ids, 'normal_bg') - if background_colour != self.background_colour: - self.background_colour = background_colour - has_any_changed = True - border_colour = self.ui_theme.get_colour_or_gradient(self.object_ids, self.element_ids, 'normal_border') if border_colour != self.border_colour: self.border_colour = border_colour