Led76 Posted October 21, 2017 Share Posted October 21, 2017 Hi My images/textures won't load when I am usng Andoid's webview to create an android app. Any ideas? I use Android studio. html/javascript code and file structure of android studio's project: Main activity: Mainactivty.xml: It's probably something obvious but could not find the solution. Many thanks Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 21, 2017 Share Posted October 21, 2017 Try add "<image src='code.png'>" in html file and see if it shows up. Quote Link to comment Share on other sites More sharing options...
Led76 Posted October 21, 2017 Author Share Posted October 21, 2017 Hi ivan It does, but the texture is not rendered on stage. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 21, 2017 Share Posted October 21, 2017 "fromImage" creates and image element and waits for it to load. You can try to write it manually to test whats wrong there, its just a few lines. Most of those problems come from CORS violations. Alternatively, you can just go for workaround: place invisible <image>'s all over the page and use "Texture.fromCanvas" instead. Quote Link to comment Share on other sites More sharing options...
Led76 Posted October 21, 2017 Author Share Posted October 21, 2017 Thanks Ivan. In case anyone else needs it in the future, I followed xerver's advise in I used something like: var img = new Image();img.src = 'images/f1.png';var base = new PIXI.BaseTexture(img), texturef = new PIXI.Texture(base); Cheers Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 21, 2017 Share Posted October 21, 2017 If it works then its strange, because "fromImage" is basically the same. May be it sets CORS parameters wrongly somehow... 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.