_
This commit is contained in:
19
UI/Objects/nr_objects/Ellipse.py
Normal file
19
UI/Objects/nr_objects/Ellipse.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pygame
|
||||
|
||||
|
||||
class Ellipse:
|
||||
def __init__(self, center, a, b, color, scene):
|
||||
self.center = center
|
||||
self.a = a
|
||||
self.b = b
|
||||
self.color = color
|
||||
self.scene = scene
|
||||
|
||||
def blit(self):
|
||||
a_ = self.a * self.scene.pd_
|
||||
b_ = self.b * self.scene.pd_
|
||||
center_ = self.scene.matrix @ self.center
|
||||
center_ = [center_[0] - a_, center_[1] - b_]
|
||||
|
||||
pygame.draw.ellipse(self.scene.s, self.color,
|
||||
pygame.Rect(center_, [a_ * 2, b_ * 2]))
|
@@ -11,4 +11,4 @@ class Line:
|
||||
|
||||
def blit(self):
|
||||
pygame.draw.line(self.scene.s, self.color, self.scene.matrix @ self.a, self.scene.matrix @ self.b,
|
||||
int(self.width * self.scene.pd))
|
||||
max(1, int(self.width * self.scene.pd)))
|
||||
|
Reference in New Issue
Block a user