Parcourir la source

Node2D.draw_rect() can now fill!

master
Bryan Miller il y a 6 ans
Parent
révision
d79c396fa4
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. +5
    -2
      game/gbe/nodes.py

+ 5
- 2
game/gbe/nodes.py Voir le fichier

@@ -284,10 +284,13 @@ class Node2D(Node):
return
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"):
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):
if not hasattr(self, "_ACTIVE_SURF"):

Chargement…
Annuler
Enregistrer