Jump to content

Texture from more Textures


zarstar
 Share

Recommended Posts

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

Link to comment
Share on other sites

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).

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...