Territhekobold Posted April 26, 2023 Share Posted April 26, 2023 So I am trying to learn more about PIXI.JS, and I have to set up an loader. I can either create my own, or I can use a premade instance that is called "shared". However when I use it I get an error message that says "Cannot read properties of undefined (reading 'shared')". What am I doing wrong? const Application = PIXI.Application; const app = new Application({ width: 500, height: 500, }); const loader = PIXI.Loader.shared; loader.add('char4Texture', '/images/2.png'); loader.load(setup);` function setup(loader, resources) { const char4Sprite = new PIXI.Sprite( resources.char4Texture ); char4Sprite.y = 400; }; I have tried to create a loader from scratch, but then I got a whole different error. Expected outcome: Picture have been added Actual outcome: Uncaught TypeError: Cannot read properties of undefined (reading 'shared') Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.