Sign in to follow this  
JeZxLee

Upgraded An Existing PixiJSv4 Game To PixiJSv5 - Now Have Bad Warning?

Recommended Posts

Hi,

We took an older PixiJSv4 game we made and upgraded it to PixiJSv5.
Game runs, but there is a bad warning in Internet browser's console & we don't know how to fix it.
Below is the details, hope someone can help us!

WARNING:
"PixiJS Deprecation Warning: PIXI.loader instance has moved to PIXI.Loader.shared
Deprecated since v5.0.0"

CODE:
var Container = PIXI.Container,
    autoDetectRenderer = PIXI.autoDetectRenderer,
    loader = PIXI.loader,
    resources = PIXI.loader.resources,
    TextureCache = PIXI.utils.TextureCache,
    Texture = PIXI.Texture,
    Sprite = PIXI.Sprite,
    Text = PIXI.Text,
    Graphics = PIXI.Graphics;

Thanks in advance!

Jesse

Share this post


Link to post
Share on other sites

Hi,

Thanks for the reply.

I made the change but it does not run in browser:

var Container = PIXI.Container,
    autoDetectRenderer = PIXI.autoDetectRenderer,
    loader = PIXI.loader.shared,
    resources = PIXI.loader.resources,
    TextureCache = PIXI.utils.TextureCache,
    Texture = PIXI.Texture,
    Sprite = PIXI.Sprite,
    Text = PIXI.Text,
    Graphics = PIXI.Graphics;

Any ideas?
Thanks!

Jesse

Share this post


Link to post
Share on other sites

it should work, i just test it in devtool
Nfu4mSpA_o.png
It same reference, so maybe you have more and another issue somewhere.
No time on my side to debug your projet sorry, but maybe wait if someone from Pixi team can help :)

Edited by jonforum

Share this post


Link to post
Share on other sites
1 hour ago, bubamara said:

it's 'Loader' with first capital letter and you need to change it for resources as well


var loader = PIXI.Loader.shared;
var resources = PIXI.Loader.shared.resources;

 

Hi...

Thanks, that actually worked!
I have some other questions that I will ask soon in the forum.

Jesse

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.