Jump to content

Problem using Pixi.js Texture.fromURL for large Images


Michmax
 Share

Recommended Posts

Hello,
I have a problem displaying large images (larger than 4k) in Pixi Canvas. 

I use the Texture.fromUrl method to read in images. When I output the resulting Texture object, it always has the same width and height for larger images, which does not correspond to the image itself.

  public static async createTexture(path: string): Promise<Texture> {
    const texture = await Texture.fromURL(path);
    texture.rotate = 8;
    return texture;
  }

I have already found out that when displaying larger images, I should split the texture object into TilingSprites and add them to the container instead of adding the whole texture object to the container. Unfortunately I don't know how to do this, since I don't get the full image information from Texture.fromUrl and thus can't split the image into TilingSprites.

Have I misunderstood something?
Does anyone know a solution for this?
I'm using PixiJS 6.5.8, if that matters.

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