【问题标题】:Black Screen when i try to use Ursina on Python当我尝试在 Python 上使用 Ursina 时出现黑屏
【发布时间】:2021-12-26 00:03:18
【问题描述】:
from ursina import *


Entity(model='quad', scale=60, texture='assets/blue_sky')
app = Ursina()

app.run()   # opens a window and starts the game.

when i run the code

the black screen with nothing

【问题讨论】:

    标签: python ursina


    【解决方案1】:

    嘿,伙计,请尝试使用较小的比例,例如 1,因为它会在所有内容上绘制一个正方形,例如十字按钮。并且有一个您的代码的更新版本

    from ursina import *
    
    app = Ursina()
    
    Entity(model='quad', scale=10, texture='assets/blue_sky')
    
    app.run() # opens a window and starts the game.
    

    【讨论】:

      【解决方案2】:

      我认为这是可行的,但只是规模太大了。通常如果比例为 15,它会覆盖整个屏幕,超过 15 的任何内容都将与 15 相同。此外,您应该在 Ursina() 之后创建实体。所以,如果你不想覆盖整个屏幕,这将是你的代码(比例可以在 1 到 15 之间,但不是 15):

      from ursina import *
      
      app = Ursina()
      
      Entity(model='quad', scale=10, texture='assets/blue_sky')
      
      app.run() # opens a window and starts the game.
      

      上面的代码对我有用,但如果它对你不起作用,我不知道是什么问题......

      【讨论】:

        【解决方案3】:

        我怀疑它确实有效。尝试使用较小的比例,例如 1。 此外,实体应该在 Ursina() 之后创建,因为有些事情会依赖于此。

        【讨论】:

        • 它说(3 个辅助显示模块尚未加载。)每次....可以吗?
        • 还是不行
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-12-19
        • 1970-01-01
        • 2015-03-31
        • 1970-01-01
        • 2021-04-15
        • 1970-01-01
        相关资源
        最近更新 更多