+import GUI.Widget as Widget
+import pygame
+
+class RectangleWidget(Widget.Widget):
+ def __init__(self, gui, x, y, w, h, fillColour, opacity, border,
+ borderThickness, borderColour) -> None:
+ super().__init__(gui)
+
+ self.screenX = x
+ self.screenY = y
+ self.screenW = w
+ self.screenH = h
+
+ self.fillColour = fillColour
+ self.opacity = opacity
+ self.border = border
+ self.borderThickness = borderThickness
+ self.borderColour = borderColour
+
+
+ self.surface = pygame.Surface((self.screenW, self.screenH))
+ self.surface.set_alpha(256 * self.opacity)
+ self.surface.fill(self.fillColour)
+
+ if self.border:
+ borderSurf = pygame.Surface((self.screenW, self.borderThickness))
+ borderSurf.fill(self.borderColour)
+ self.surface.blit(borderSurf, (0, 0))
+
+ borderSurf = pygame.Surface((self.screenW, self.borderThickness))
+ borderSurf.fill(self.borderColour)
+ self.surface.blit(borderSurf, (0, self.screenH - self.borderThickness))
+
+ borderSurf = pygame.Surface((self.borderThickness, self.screenH))
+ borderSurf.fill(self.borderColour)
+ self.surface.blit(borderSurf, (0, 0))
+
+ borderSurf = pygame.Surface((self.borderThickness, self.screenH))
+ borderSurf.fill(self.borderColour)
+ self.surface.blit(borderSurf, (self.screenW - self.borderThickness, 0))
\ No newline at end of file