zarstar Posted July 22, 2014 Share Posted July 22, 2014 Hi guys,I have a particoular problem with Pixi.js.I am working on a large application in which there would be a lot of images displayed. Now the problem is that some of them should be "composed".So pratically the resulting Sprite should have for example, a Texture composed by four images:[1,1] [1,2][2,1] [2,2]Each of them is an image file (so "1-1.jpg", "1-2.jpg", and so on...). I have tried to use a Sprite as a container of other Sprites and it works, but it seems quite slow and it takes a lot of memory.So I tried to use the RenderTexture class, but it needs that the objects to render should be preloaded (the application is large, so it can't wait images to be loaded).So finally I tried to use the fromCanvas() method. But it also seems to use a lot of memory, because it stores a Canvas for each Sprite (and I could have very large Canvases). So what do you suggest me?Is there any other way to compose a Texture for more image files? Thank you Quote Link to comment Share on other sites More sharing options...
xerver Posted July 22, 2014 Share Posted July 22, 2014 Have you tried using a DisplayObjectContainer or SpriteBatch as the container? Quote Link to comment Share on other sites More sharing options...
zarstar Posted July 23, 2014 Author Share Posted July 23, 2014 I solved using the RenderTexture in the end, with an event listener for each Texture loaded.Pratically when an image is loaded it renders it into the RenderTexture, so they are displayed as soon as possible (while other images are still loading). 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.