实现打包功能

This commit is contained in:
Hector 2025-09-26 17:50:04 +08:00
parent c9abf0b698
commit 9c4116319b

View File

@ -323,7 +323,7 @@ class MainApp(ShowBase):
pos=tuple(absolute_position),
text=text,
size=absolute_scale[0] if absolute_scale and len(absolute_scale) > 0 else 1.0,
command=self.resetWomenModel
#command=self.resetWomenModel
)
elif gui_type == "label":
new_element = self.createGUILabel(
@ -352,7 +352,7 @@ class MainApp(ShowBase):
new_element = self.createGUI2DVideoScreen(
pos=tuple(absolute_position),
video_path=video_path,
size=scale_value * 0.2
size=absolute_scale
)
except Exception as e:
print(f"重建GUI元素失败 {name}: {e}")
@ -548,8 +548,15 @@ class MainApp(ShowBase):
from panda3d.core import TransparencyAttrib, Texture, TextureStage
import os
if isinstance(size,(list,tuple)) and len(size) >= 2:
width_scale = size[0]*0.2
height_scale = size[2]*0.2
else:
width_scale = size*0.1 if isinstance(size,(int,float)) else 0.2
height_scale = width_scale
video_screen = DirectFrame(
frameSize=(-size, size, -size, size),
frameSize=(-width_scale, width_scale, -height_scale, height_scale),
frameColor=(1, 1, 1, 1),
pos=pos,
parent=None,
@ -567,6 +574,8 @@ class MainApp(ShowBase):
if movie_texture:
video_screen["frameTexture"] = movie_texture
return video_screen
def _loadMovieTexture(self, video_path):
from panda3d.core import Texture, MovieTexture
import os