R
R
rekoshets2021-11-01 12:10:07
Python
rekoshets, 2021-11-01 12:10:07

Why is the texture not loading?

from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController

app = Ursina()

grass_texture = load_texture('assets/grass_blockbad.png')

class Voxel(Button):
def __init__(self, position = (0,0,0)) :
super().__init__(
parent = scene,
position = position,
model = 'assets/block',
origin_y = 0.5,
texture = grass_texture ,
color = color.color(0,0,random.uniform(0.9,1)) ,
highlight_color = color.lime,
scale = 0.5)

def input(self,key):
if self.hovered:
if key == 'right mouse down':
voxel = Voxel(position = self.position + mouse.normal)
if key == 'left mouse down':
destroy(self)
if key == 'escape':
exit(0);
if key == 'f11':
window.fullscreen = True


for z in range(30):
for x in range(30):
voxel = Voxel(position = (x,0,z))
player = FirstPersonController()

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question