MCPcopy Index your code
hub / github.com/ICE27182/Python-3D-renderer / change_texture

Method change_texture

pyrender.py:493–508  ·  view source on GitHub ↗
(self, file_path)

Source from the content-addressed store, hash-verified

491
492
493 def change_texture(self, file_path):
494 img = file_path.replace("\\", "/")
495 # Absolute path
496 if not isfile(img):
497 print("\033[1;31m" +
498 "WARNING: TEXTURE FILE NO FOUND.\n")
499 sleep(2)
500 else:
501 self.texture = png.Png(img, "")
502 self.texture_path = img
503 # width and height will be used in uv mapping
504 # u/v * width/height
505 # if not substracted by 1,
506 # the index will be out of range when u/v == 1
507 self.texture.width -= 1
508 self.texture.height -= 1
509
510 def load_img(self):
511 if self.texture_path:

Callers 2

pymain.pyFile · 0.80
prefinal.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected