所以我开始使用一个名为 Ursina Engine 的 Python API,我到了需要添加纹理的地步。无论我为文件路径放置什么,总是不会渲染。没有错误,只是一个空白实体。
from ursina import * # import everything we need with one line.
#an entity is basically anything you can see or hear/interact on a screen
def update():#updtes every frame
if held_keys['a']:
test_square.x -= 1 * time.dt #so the .x is the axis (you can use y too and -= minuses every frame), multiplying it by time.delta means it will move in accordance with the framerate
# time.dt is the completion time between the last frame
if held_keys['d']:
test_square.x += 1 * time.dt
app = Ursina()
test_square = Entity(model = 'quad', color = color.red, scale = (1,4), position = (3,1))#x then y for scale and pos
sans_texture = load_texture('sans.png')
sand = Entity(model = 'quad', texture = sans_texture)
app.run()