2021-09-13 20:32:50 +02:00
|
|
|
from TuGUI.Objects.Scene import Scene
|
2021-09-01 11:26:29 +02:00
|
|
|
from numpy import array as a
|
|
|
|
|
2021-09-13 20:32:50 +02:00
|
|
|
from TuGUI.Objects.nr_objects.Ellipse import Ellipse
|
|
|
|
from TuGUI.Objects.nr_objects.Circle import Circle
|
|
|
|
from TuGUI.Objects.nr_objects.EquilateralTriangle import EquilateralTriangle
|
|
|
|
from TuGUI.Objects.nr_objects.Image import Image
|
|
|
|
from TuGUI.Objects.nr_objects.Line import Line
|
|
|
|
from TuGUI.Objects.nr_objects.Text import Text
|
|
|
|
from TuGUI.Objects.r_objects.Rect import Rect
|
2021-09-01 11:26:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
class BasicScene(Scene):
|
2021-09-01 22:22:18 +02:00
|
|
|
def __init__(self, scene_size: a, bg=(60, 60, 60)):
|
2021-09-01 11:26:29 +02:00
|
|
|
|
2021-09-02 19:56:28 +02:00
|
|
|
self.s__size = [600, 400]
|
2021-09-01 11:26:29 +02:00
|
|
|
|
2021-09-02 19:56:28 +02:00
|
|
|
super().__init__(self.s__size[0], self.s__size[1], scene_size, bg)
|
2021-09-01 11:26:29 +02:00
|
|
|
|
|
|
|
r0 = Rect(a([0, 0]), a([200, 200]), (160, 160, 160), self)
|
2021-09-01 17:32:53 +02:00
|
|
|
|
|
|
|
l0 = Line(a([100, 300]), a([500, 100]), 3, (255, 100, 100), self)
|
|
|
|
|
|
|
|
c0 = Circle(a([400, 200]), 40, (100, 100, 255), self)
|
2021-09-01 18:23:35 +02:00
|
|
|
|
|
|
|
e0 = Ellipse(a([150, 360]), 60, 20, (100, 255, 100), self)
|
2021-09-01 22:22:18 +02:00
|
|
|
|
|
|
|
t0 = Text(a([100, 50]), "hello world!", 26, (200, 200, 200), self)
|
2021-09-02 13:35:27 +02:00
|
|
|
|
2021-09-13 20:21:11 +02:00
|
|
|
i0 = Image(a([200, 0]), 0.8, "sample_image.png", self)
|
2021-09-02 19:56:28 +02:00
|
|
|
|
2021-09-06 18:32:02 +02:00
|
|
|
triangle0 = EquilateralTriangle(a([500, 300]), 30, 1, (250, 250, 150), self)
|
|
|
|
|
|
|
|
self.sort_objects(r0, l0, c0, e0, t0, i0, triangle0)
|