dev.demid Posted March 31, 2018 Share Posted March 31, 2018 Hello! I'm new in Pixi, and I'm really sorry if if the issue was discussed earlier, but the last 6 hours of search did not give me the result. Soo... I'm trying to figure out if it's possible to repeat this example without using a "loader". I'm using react and webpack, so all my files (json/pictures) are already inside bundle and I don't really want to load them from the side (assets). an example I want to repeat - http://pixijs.io/examples/#/basics/container-pivot.js my component code - https://gist.github.com/demidborodin/209a3124ebb61e1f486717bb5d6fe503 I will be very happy if you give me a working example, since I have not found anything like this. Quote Link to comment Share on other sites More sharing options...
PsichiX Posted March 31, 2018 Share Posted March 31, 2018 your assets may be bundled, but despite of their bundled form (inlined b64 or image assets), they still need to be loaded into engine and this is not the case of 'use image from b64 string/asset' - this is not how game engines works. bundle images as assets and load them properly by pixi loader by url. tell me, you bundle them to provide some basic anti-piracy? if yes, then you have to do it in different way: you'll have to pack your assets into asset pack and then load pack, unpack images into blobs and load blobs with loader. i have solved this problem long time ago, but my solution will force you to use 3rd party loader, which you may not want to use because of addiyional abstraction layer. dev.demid 1 Quote Link to comment Share on other sites More sharing options...
PsichiX Posted March 31, 2018 Share Posted March 31, 2018 i've found a hack: somehow get bundled image object or its b64 form and feed it into newly created basetexture and texture and add it to cache, using that hack: https://github.com/pixijs/pixi.js/issues/204 i'm saying it's a hack, because it still does not gives you an easy solution for your problem, which modern engines should solve for you, but hey - at some point even old engines may get to the point where they will solve modern problems, so good luck and use that hack ;D dev.demid 1 Quote Link to comment Share on other sites More sharing options...
dev.demid Posted April 1, 2018 Author Share Posted April 1, 2018 14 hours ago, PsichiX said: i have solved this problem long time ago, but my solution will force you to use 3rd party loader, which you may not want to use because of addiyional abstraction layer. Thanks you for answer! It seems I'm starting to understand how pixi works and loading resources. I still would like to see yours and can show you?) Quote Link to comment Share on other sites More sharing options...
PsichiX Posted April 1, 2018 Share Posted April 1, 2018 i think i could, but i have to make wrapper for pixi loader so it could use modern loading from assets pack file and unfortunately i'm doing some other integration right now, so it will takesome time. just send me a PM so i will not forget Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 1, 2018 Share Posted April 1, 2018 Oh, you mean react resource pack? Please use the search, this all was solved multiple times. Just type "react" in the search box for this subforum. You can also look up pixi-react and its authors. 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.