Browse Source

Node2D.draw_rect() can now fill!

master
Bryan Miller 6 years ago
parent
commit
d79c396fa4
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      game/gbe/nodes.py

+ 5
- 2
game/gbe/nodes.py View File

return return
pygame.draw.lines(self._ACTIVE_SURF, color, closed, points, thickness) pygame.draw.lines(self._ACTIVE_SURF, color, closed, points, thickness)


def draw_rect(self, rect, color, thickness=1):
def draw_rect(self, rect, color, thickness=1, fill_color=None):
if not hasattr(self, "_ACTIVE_SURF"): if not hasattr(self, "_ACTIVE_SURF"):
return return
pygame.draw.rect(self._ACTIVE_SURF, color, rect, thickness)
if fill_color is not None:
self._ACTIVE_SURF.fill(fill_color, rect)
if thickness > 0:
pygame.draw.rect(self._ACTIVE_SURF, color, rect, thickness)


def draw_ellipse(self, rect, color, thickness=1, fill_color=None): def draw_ellipse(self, rect, color, thickness=1, fill_color=None):
if not hasattr(self, "_ACTIVE_SURF"): if not hasattr(self, "_ACTIVE_SURF"):

Loading…
Cancel
Save