GithubHelp home page GithubHelp logo

How the pixi is detected about pixi-inspector HOT 4 CLOSED

bfanger avatar bfanger commented on August 28, 2024
How the pixi is detected

from pixi-inspector.

Comments (4)

kresli avatar kresli commented on August 28, 2024

Would be nice if extension would have iframe selector

from pixi-inspector.

kresli avatar kresli commented on August 28, 2024

Related #34

from pixi-inspector.

kresli avatar kresli commented on August 28, 2024

I tried to add following

<script>
  window.addEventListener("load", () => {
    const frame = document.getElementById("storybook-preview-iframe");
    const PIXI = frame.contentWindow.PIXI;
    setTimeout(() => {
      window.__PIXI_INSPECTOR_GLOBAL_HOOK__ &&
        window.__PIXI_INSPECTOR_GLOBAL_HOOK__.register({ PIXI: PIXI });
    }, 3000);
  });
</script>

I load unpacked extension and seems like PIXI is detected

image
but the inspector still looking for pixi.js

from pixi-inspector.

kresli avatar kresli commented on August 28, 2024

Explicit preview-head.html works
preview-head.html as in docs https://storybook.js.org/docs/configurations/add-custom-head-tags/

<body>
  <div id="pixi-canvas"></div>
  <script src="./pixi.js/dist/pixi.js"></script>
  <script>
    console.log(window);
    const app = new PIXI.Application({ antialias: true });
    document.getElementById("pixi-canvas").appendChild(app.view);
    console.log(document.getElementById("pixi-canvas"));

    const graphics = new PIXI.Graphics();

    // Rectangle
    graphics.beginFill(0xde3249);
    graphics.drawRect(50, 50, 100, 100);
    graphics.endFill();
    app.stage.addChild(graphics);
  </script>
</body>

Also I can confirm create application inside any files picked by webpack works.
I suspect the wrapper which I'm using causing the issue https://github.com/michalochman/react-pixi-fiber. Closing the issue.

from pixi-inspector.

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.