From 52cdfdfac6564aaf1b82a65ff22b6d2e46eca65a Mon Sep 17 00:00:00 2001 From: march3 Date: Wed, 3 Apr 2024 16:28:06 +0800 Subject: [PATCH] =?UTF-8?q?Python=E8=B6=85=E4=BA=BA-=E5=AE=87=E5=AE=99?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim_scenes/featured/earth_seasons_live.py | 36 +++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/sim_scenes/featured/earth_seasons_live.py b/sim_scenes/featured/earth_seasons_live.py index c6143a2..481d313 100644 --- a/sim_scenes/featured/earth_seasons_live.py +++ b/sim_scenes/featured/earth_seasons_live.py @@ -55,7 +55,7 @@ class EarthSeasonsSimLive(EarthSeasonsSimBase): for body in self.bodies: if isinstance(body, Earth): - body.show_name = False + body.show_name = True body.rotate_angle -= 22 body.rotation_speed *= 2.5 body.set_resolution(50) @@ -64,21 +64,27 @@ class EarthSeasonsSimLive(EarthSeasonsSimBase): self.planets = [] self.jieqis = { - "春分-2023": '2023-03-21 00:00:00', - "夏至-2023": '2023-06-21 00:00:00', - "秋分-2023": '2023-09-23 00:00:00', - "冬至-2023": '2023-12-22 00:00:00', + # "春分-2023": '2023-03-21 00:00:00', + # "夏至-2023": '2023-06-21 00:00:00', + # "秋分-2023": '2023-09-23 00:00:00', + # "冬至-2023": '2023-12-22 00:00:00', + "春分-2023": '2024-03-20 00:00:00', + "夏至-2023": '2024-06-21 00:00:00', + "秋分-2023": '2024-09-22 00:00:00', + "冬至-2023": '2024-12-21 00:00:00', "春分-2024": '2024-03-20 00:00:00', "夏至-2024": '2024-06-21 00:00:00', "秋分-2024": '2024-09-22 00:00:00', "冬至-2024": '2024-12-21 00:00:00', - "春分-2025": '2025-03-20 00:00:00', - "夏至-2025": '2025-06-21 00:00:00', - "秋分-2025": '2025-09-23 00:00:00', - "冬至-2025": '2024-12-21 00:00:00', + # "春分-2025": '2025-03-20 00:00:00', + # "夏至-2025": '2025-06-21 00:00:00', + # "秋分-2025": '2025-09-23 00:00:00', + # "冬至-2025": '2024-12-21 00:00:00', } font = "fonts/DroidSansFallback.ttf" + + # font = "fonts/新青年体.ttf" from common.func import find_file self.font = find_file(f"{font}", UrsinaConfig.CN_FONT) @@ -86,7 +92,8 @@ class EarthSeasonsSimLive(EarthSeasonsSimBase): if body not in self.season_earths: self.planets.append(body) else: - body.texture = "transparent.png" + # body.texture = "transparent.png" + body.size_scale = self.earth.size_scale / 1.1 body.show_trail = False def earth_text_display(self, term_name): @@ -113,11 +120,16 @@ class EarthSeasonsSimLive(EarthSeasonsSimBase): # UrsinaConfig.trail_length = 1000 UrsinaConfig.trail_thickness_factor = 2 - for body in self.bodies: + for body in self.planets: body.planet.trail_scale = 3 + body.planet.name_text.scale = 5 + destroy(body.planet.name_text.background) + body.planet.name_text.color = color.white + body.planet.name_text.font = self.font + body.planet.name_text.position = Vec3(0,pow(body.planet.main_entity.scale_y,1/12)/2,0) self.moon.planet.trail_scale = 1 - + # camera.orthographic = True camera.clip_plane_near = 1 # camera.clip_plane_far = sky.scale_x * 1.5 -- GitLab