[Python] Ursina Engine textures

Discussão em 'Python' iniciado por Stack, Junho 9, 2025.

  1. Stack

    Stack Membro Participativo

    So I started playing with an API for python called Ursina Engine and I got to the point I need to add a texture. Whatever I put for the file path, always just doesn't render. No errors, just a blank entity.

    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()

    Continue reading...

Compartilhe esta Página