Jump to content

V3 loader vs V2 loader


Go to solution Solved by xerver,

Recommended Posts

New to Pixi.js and JS OOP in general. 

The old super simple v2 asset loader looks like this (but doesn't work with pixi.js V3):

var loader = new PIXI.AssetLoader(["images/cat.png"]);loader.onComplete = setup;loader.load();

What's does the new V3 asset loader look like? 

Did the loaders for Atlas change too?
What else changed in V3 where V2 code no longer works?

 

Thanks, was pulling my hair out trying to do a tutorial, found out it was not working cause I had v2 code in the project with V3 pixi version :( grrr...
 

Link to post
Share on other sites
  • Solution

Pixi v3 uses a new module we built called "resource-loader":

https://github.com/englercj/resource-loader

A pre-made instance with the Pixi.js built-in middleware is available for use at "PIXI.loader". You can also create your own custom one by creating an instance of "PIXI.loaders.Loader".

Your example using the v3 loader:
 

PIXI.loader.add('images/cat.png').load(setup);
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...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...