Jump to content

PIXI+ANGULAR: Sprite+Texture loaded but not visible


dszidi
 Share

Recommended Posts

Hello again. I've been on a roll with PIXI 4.8.7 and Angular 7. Up until now I have not needed to load images so things have gone pretty smoothly. 
Unfortunately I have run into an issue with loading images.

I've tried doing a simple method using just PIXI.Texture.fromImage()  as well as using a loader like in this example...

In both cases the problem is the same. No image is ever shown in the canvas. I log the stage, container, Sprite and Loader.resources and everything seems to check out.

There is a texture present and the image must have loaded because it reports the correct image dimensions. For some reason there is nothing on the screen. I made sure to add .bind(this) to the callback name

I'm stumped at the moment and could use some guidance. If anybody could link me to a working example of how to do this or tips on how to trouble shoot this further I would really appreciate it. Been wrestling with this all weekend and really need to get back on track.

 

Thanks in advance for any help.

Link to comment
Share on other sites

NVM. It seems to be an issue with the image itself. I just tried another image (much lower resolution jpg) and it works. The image I was trying to load is a hi resolution png with transparent background. Strange. I will post back here if I find a resolution.

Link to comment
Share on other sites

Ok, that makes a lot of sense. I was going to optimize the image anyway. Good to know. I will try this after lunch. 

I have to congratulate the PIXI devs. So far it has been a very pleasant experience working with PIXI. My only issues so far have been related to my inexperience with PIXI and integrating it with other tools.

I am loving it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...