GithubHelp home page GithubHelp logo

Comments (5)

GoodBoyDigital avatar GoodBoyDigital commented on April 28, 2024

heya! thankyou for posting, Im not sure .json extension is considered a valid image format?

from pixijs.

GoodBoyDigital avatar GoodBoyDigital commented on April 28, 2024

if the names were changed from textures/house/[email protected] -> textures/house/[email protected] do things work as expect? Thank you for checking!

from pixijs.

Zyie avatar Zyie commented on April 28, 2024

it looks like you are using assetpack, so I think you need to add a json resolver so pixi can tell what resolution it is
There is a small section of docs about it here

and here is the code snippet

import { Resolver, extensions, resolveTextureUrl, ResolveURLParser, ExtensionType } from 'pixi.js';

export const resolveJsonUrl = {
    extension: ExtensionType.ResolveParser,
    test: (value: string): boolean =>
        Resolver.RETINA_PREFIX.test(value) && value.endsWith('.json'),
    parse: resolveTextureUrl.parse,
} as ResolveURLParser;

extensions.add(resolveJsonUrl);

it is also interesting that this worked in v7 but not v8. I dont believe much was changed between the two versions when it comes to assets

from pixijs.

gabrielecirulli avatar gabrielecirulli commented on April 28, 2024

@Zyie's solution works. I think where I got side-tracked is that back when I was attempting to use assetpack with Pixi.js, after extensive debugging I realized that resolutions were not being considered because assetpack would output names such as [email protected] instead of [email protected], which is the only pattern that Pixi v7 would recognize. That's why I modified assetpack to support this, but such modification may not make sense anymore in light of the ability to add a custom resolver.

It may be worth documenting whether the above approach works with both v7 and v8, or only with v8.

from pixijs.

Zyie avatar Zyie commented on April 28, 2024

I've added the json resolver by default now, so hopefully all is fixed

from pixijs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.