Info_edupage/UI/Scenes/BasicScene.py

38 lines
1.2 KiB
Python
Raw Normal View History

2021-09-01 11:26:29 +02:00
from Objects.Scene import Scene
from Objects.r_objects import *
from numpy import array as a
import numpy as np
2021-09-01 18:23:35 +02:00
from UI.Objects.nr_objects.Ellipse import Ellipse
2021-09-01 17:32:53 +02:00
from UI.Objects.nr_objects.Circle import Circle
2021-09-02 13:35:27 +02:00
from UI.Objects.nr_objects.Image import Image
2021-09-01 17:32:53 +02:00
from UI.Objects.nr_objects.Line import Line
2021-09-01 22:22:18 +02:00
from UI.Objects.nr_objects.Text import Text
2021-09-01 11:26:29 +02:00
from UI.Objects.r_objects.Rect import Rect
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
s__size = [600, 400]
2021-09-01 22:22:18 +02:00
super().__init__(s__size[0], 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)
self.r_objects.append(r0)
2021-09-01 17:32:53 +02:00
l0 = Line(a([100, 300]), a([500, 100]), 3, (255, 100, 100), self)
self.nr_objects.append(l0)
c0 = Circle(a([400, 200]), 40, (100, 100, 255), self)
self.nr_objects.append(c0)
2021-09-01 18:23:35 +02:00
e0 = Ellipse(a([150, 360]), 60, 20, (100, 255, 100), self)
self.nr_objects.append(e0)
2021-09-01 22:22:18 +02:00
t0 = Text(a([100, 50]), "hello world!", 26, (200, 200, 200), self)
self.nr_objects.append(t0)
2021-09-02 13:35:27 +02:00
i0 = Image(a([200, 0]), 0.8, "test.png", self)
self.nr_objects.append(i0)