简体   繁体   English

如何在 URSINA 引擎(Python)中设置 WINDOW 背景

[英]HOW TO SET WINDOW BACKGROND IN URSINA ENGINE (PYTHON)

I can't set my game's window backgroun image.我无法设置游戏的 window 背景图片。

This is what I have tried:这是我试过的:

mainbg = Sky(texture = 'Assets/ruined_city_main_bg')

But that was incomprehensible and scary.但那是不可理解和可怕的。 Also I have tried:我也试过:

mainbg = Entity(parent = camera.ui, '''All other arguments''', texture = 'Assets/ruined_city_main_bg', position = (0, 0))

The "ENTITY BG" is not showing. “实体 BG”未显示。

You can't see it because you didn't give it a model. Try adding model='quad' .你看不到它,因为你没有给它一个 model。尝试添加model='quad'

mainbg = Entity(parent=camera.ui, model='quad', texture='ruined_city_main_bg')

it looks like you are not setting the file extension.看起来你没有设置文件扩展名。

For example: ruined_city_main_bg.png例如: ruined_city_main_bg.png

where .png is an image extension.其中.png是图像扩展名。

or try:或尝试:

skybox_image = load_texture("sky_sunset.jpg") skybox_image = load_texture("sky_sunset.jpg")

Sky(texture=skybox_image)天空(纹理=天空盒图像)

Don't forget the file extension.不要忘记文件扩展名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM