@@ -459,19 +459,17 @@ def getAtlas(this):
459
459
"""Get atlas image.
460
460
"""
461
461
if this .file in ['' , None ]:
462
- image = Texture (PIL .Image .new ('RGBA' , this .imgSize ))
463
- this .atlas = image .image .copy ()
462
+ this .atlas = Texture (PIL .Image .new ('RGBA' , this .imgSize )).image
464
463
else :
465
- image = Texture (
464
+ this . atlas = Texture (
466
465
this .file ,
467
466
HD = this .HD ,
468
467
TabHD = this .TabHD ,
469
468
filesystem = this .filesystem ,
470
469
gamepath = this .gamepath ,
471
470
assets = this .assets ,
472
471
baseassets = this .baseassets ,
473
- )
474
- this .atlas = image .image .copy ()
472
+ ).image
475
473
476
474
def getImages (this , save_images = False ):
477
475
"""Get images from xml.
@@ -682,6 +680,16 @@ def _updateAtlas(this) -> PIL.Image.Image:
682
680
atlas .paste (image .image , image .rect [0 :2 ])
683
681
684
682
this .atlas = atlas
683
+
684
+ # this.atlas = Texture(
685
+ # atlas,
686
+ # filesystem = this.filesystem,
687
+ # gamepath = this.gamepath,
688
+ # assets = this.assets,
689
+ # baseassets = this.baseassets,
690
+ # HD = this.HD,
691
+ # TabHD = this.TabHD,
692
+ # )
685
693
return this .atlas
686
694
687
695
class Image (GameObject ):
@@ -793,7 +801,7 @@ def rect(this, value : tuple | list | str):
793
801
794
802
@property
795
803
def name (this ) -> str :
796
- """The name of the iamge
804
+ """The name of the image
797
805
798
806
Returns:
799
807
str: image name
@@ -835,10 +843,29 @@ def getImage(this) -> PIL.Image.Image:
835
843
this ._image .save (this .rawdata , format = os .path .splitext (this .name )[1 ][1 ::].upper ())
836
844
return this ._image
837
845
838
- def show (this ):
839
- """Show image with default image viewer.
846
+ def show (this , * args , ** kwargs ):
847
+ """Calls the PIL.Image.Image.show() method.
848
+
849
+ ---
850
+ #### Description copied from the PIL library
851
+
852
+ Displays this image. This method is mainly intended for debugging purposes.
853
+
854
+ This method calls PIL.ImageShow.show internally. You can use
855
+ PIL.ImageShow.register to override its default behavior.
856
+
857
+ The image is first saved to a temporary file. By default, it will be in PNG format.
858
+
859
+ On Unix, the image is then opened using the **display**, **eog** or **xv** utility, depending on which one can be found.
860
+
861
+ On macOS, the image is opened with the native Preview application.
862
+
863
+ On Windows, the image is opened with the standard PNG display utility.
864
+
865
+ Args:
866
+ title (str | None, optional): Optional title to use for the image window, where possible.. Defaults to None.
840
867
"""
841
- this .image .show ()
868
+ this .image .show (* args , ** kwargs )
842
869
843
870
def getXML (this , tag = 'Image' ):
844
871
"""Get xml for image.
0 commit comments