Info_edupage/UI/Objects/nr_objects/Line.py

18 lines
422 B
Python
Raw Normal View History

2021-09-01 17:32:53 +02:00
import pygame.draw
class Line:
2021-09-06 18:32:02 +02:00
object_type = "nr"
2021-09-01 17:32:53 +02:00
def __init__(self, a, b, width, color, scene):
self.a = a
self.b = b
self.width = width
self.color = color
self.scene = scene
def blit(self):
pygame.draw.line(self.scene.s, self.color, self.scene.matrix @ self.a, self.scene.matrix @ self.b,
2021-09-01 18:23:35 +02:00
max(1, int(self.width * self.scene.pd)))