From 223bea168de8cee6f921f1ec940520965968b02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Mon, 24 Jun 2024 22:32:27 +0300 Subject: [PATCH] d --- v5/Window.py | 3 ++- v5/desktop.py | 10 ++++++++++ v5/desktop_Platform.py | 10 ++++++++++ v5/desktop_Window.py | 22 ++++++++++++++++++++++ v5/main-gui.py | 9 +++++++-- 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 v5/desktop.py create mode 100644 v5/desktop_Platform.py create mode 100644 v5/desktop_Window.py diff --git a/v5/Window.py b/v5/Window.py index fbe0c1d..ee3b934 100644 --- a/v5/Window.py +++ b/v5/Window.py @@ -3,6 +3,7 @@ import arcade CELL = 25 HEIGHT = 600 WIDTH = 900 +TITLE = "OGS Memory" class Context: def __init__(self): @@ -39,7 +40,7 @@ class Context: class Window(arcade.Window): def __init__(self): - super().__init__(WIDTH, HEIGHT, "OGS Memory") + super().__init__(WIDTH, HEIGHT, TITLE) arcade.set_background_color(arcade.color.WHITE) self.all_sprites = arcade.SpriteList() self.c = Context() diff --git a/v5/desktop.py b/v5/desktop.py new file mode 100644 index 0000000..9c1dfea --- /dev/null +++ b/v5/desktop.py @@ -0,0 +1,10 @@ +from desktop_Platform import * + +# Configure window parameters +def desktop_configureFixedWindow(p): + p.cell = 25 + p.windowAntialiasing = False + p.windowHeight = 600 + p.windowTitle = "OGS Memory" + p.windowWidth = 900 +#} diff --git a/v5/desktop_Platform.py b/v5/desktop_Platform.py new file mode 100644 index 0000000..cb134ad --- /dev/null +++ b/v5/desktop_Platform.py @@ -0,0 +1,10 @@ +import arcade + +class desktop_Platform: + def __init__(self): + self.cell = 0 + self.sprites = arcade.SpriteList() + self.title = "" + self.windowBackgroundColor = arcade.color.WHITE + self.windowHeight = 0 + self.windowWidth = 0 diff --git a/v5/desktop_Window.py b/v5/desktop_Window.py new file mode 100644 index 0000000..9112cc9 --- /dev/null +++ b/v5/desktop_Window.py @@ -0,0 +1,22 @@ +import arcade + +class desktop_Window(arcade.Window): + def __init__(self, p): + super().__init__( + p.windowWidth, + p.windowHeight, + p.windowTitle, + ) + self.antialiasing = p.windowAntialiasing + arcade.set_background_color(p.windowBackgroundColor) + self.p = p + + def on_draw(self): + arcade.start_render() + self.p.sprites.draw() + + def on_mouse_press(self, x, y, button, key_modifiers): + print("click", x, y) + + def on_update(self, delta): + pass diff --git a/v5/main-gui.py b/v5/main-gui.py index 0234209..9ecdbbb 100644 --- a/v5/main-gui.py +++ b/v5/main-gui.py @@ -3,12 +3,14 @@ from cli import * from cli_test import * from ctx import * from ctx_test2 import * +from desktop import * +from desktop_Platform import * +from desktop_Window import * from gui import * from gui_test import * from llm_test import * from llm_test_Python import * from memory_test import * -from Window import * import sys print(ctx_test_Controller_executeFunctions_registerFunction_set()) @@ -81,5 +83,8 @@ ctrl.set("tileImageCount", 3) ctrl.set("tileImageHeight", 100) ctrl.set("tileImageWidth", 75) -wnd = Window() +p = desktop_Platform() +desktop_configureFixedWindow(p) + +wnd = desktop_Window(p) arcade.run()