Giter Club home page Giter Club logo

Comments (14)

jdnichollsc avatar jdnichollsc commented on May 14, 2024 2

Ok give me a moment to fix the issue with this peer dependency

from ion-phaser.

Marchiuzzz avatar Marchiuzzz commented on May 14, 2024 2

I am using Vue and also need Phaser version of 3.50 or higher. I am a bit confused since in package.json I do have "phaser": "^3.52.0" but none of the functions which came with 3.5 work for me

from ion-phaser.

NilsMinor avatar NilsMinor commented on May 14, 2024 1

I am using angular and it works really well :) But I have some issues with version 3.19 and I hope that these issues are fixed in a newer version. But as ion-phaser depends on 3.19 I am not able to update. Thanks for updating @jdnichollsc πŸ‘

from ion-phaser.

NilsMinor avatar NilsMinor commented on May 14, 2024 1

HeyΒ @jdnichollsc sorry for bugging you :D did you came up with a solution?
Best regards,
Nils

from ion-phaser.

NilsMinor avatar NilsMinor commented on May 14, 2024

Hey @jdnichollsc any updates on this topic? I also would like to use phaser 3.52 but ion-phaser depends on 3.19 :)

from ion-phaser.

ccolomboext avatar ccolomboext commented on May 14, 2024

Hey @NilsMinor,

As a workaround I endup creating a React componenet that manages Phaser's game instance. Here follows the base code for the componenet, maybe you'll have to tweak your CSS to actually show the canvas but that depends a lot on your layout. Hope it helps, beign that I'm not sure you're using React....

import React from "react";
import Phaser from "phaser";

let game = null;

class Game extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div id="game-container"></div>
    );
  }

  componentDidMount() {
      game = new Phaser.Game({
        type: Phaser.AUTO,
        parent: "game-container",
        scale: {
          mode: Phaser.Scale.RESIZE,
          autoCenter: Phaser.Scale.CENTER_BOTH,
        },
        scene: [BootScene],
      });
  }

  getScene(key) {
    if (game && game.scene) {
      return game.scene.getScene(key);
    }
  }

  callFunctionInsideScene() {
    this.getScene("SomeGameSceneKey").doSomethingInsideTheScene();
  }

  componentWillUnmount() {
    game.destroy(true);
    game = null;
  }
}

from ion-phaser.

jdnichollsc avatar jdnichollsc commented on May 14, 2024

Let me fix that during this weekend, if you are using React you can try using hooks: https://stackblitz.com/edit/react-phaser

from ion-phaser.

NilsMinor avatar NilsMinor commented on May 14, 2024

Hey :) Any updates on the ion-phaser/phaser dependency ? I do not really understand how to fix this problem by myself with adding any code to the package.json for example, so I really need you to update the dependency inside ion-phaser ^^

Thanks, Nils :)

from ion-phaser.

jdnichollsc avatar jdnichollsc commented on May 14, 2024

Let me try to do that ASAP, I need to identify what's the problem with the current configuration because Phaser is a peer dependency, very odd

from ion-phaser.

jdnichollsc avatar jdnichollsc commented on May 14, 2024

Do you know any good npm package to analyze bundle size locally?

from ion-phaser.

NilsMinor avatar NilsMinor commented on May 14, 2024

I never used a nom package to analyze the size but this (https://www.npmjs.com/package/webpack-bundle-analyzer) seams to do exactly what you are looking for ? :)

from ion-phaser.

jdnichollsc avatar jdnichollsc commented on May 14, 2024

I'm trying to solve the issue with this peer dependency, any reaction or comment from the below issue itself is really appreciated! ionic-team/stencil#2829

from ion-phaser.

jdnichollsc avatar jdnichollsc commented on May 14, 2024

Please check the new version and let me know πŸ‘

from ion-phaser.

jdnichollsc avatar jdnichollsc commented on May 14, 2024

Let me know if the issue persist, thanks!

from ion-phaser.

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.