(self, file_path)
| 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: |
no outgoing calls
no test coverage detected