mircha

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. mircha

    physics library

    Ivan, what should we do to make a game that requires physics? "DONT USE PIXIJS WITH PHYSICS LIBRARIES", that is, shouldn't we use pixi.js to make the game? I want to create something like this: https://phaser.io/examples/v3/view/physics/matterjs/chain don't we need physics library to build it? I'm sorry, I'm a beginner, and by reading your post, I had this question.
  2. thank you. with using loader my problem solved.
  3. Hi. First of all, I want to thank the members of the Pixi.js team for developing this great library. My problem is in using sprite height. For example, see the code below. let onKey = PIXI.Sprite.from("ont.png"); onKey.x = 50; onKey.y = window.innerHeight - (onKey.height + 50); console.log(onKey.height); onKey.scale.set(0.3); app.stage.addChild(onKey); here I want to use sprite height to set a sprite y, but sprite height is always a number between 0 to 1! in this code onKey.height is 1 and if I change the location of onKey.scale.set(0.3) to above the onKey.y, the onKey.height will change to 0.3. I want to use the actual size of the sprite height not its scale. The strange thing is that when I refresh the page several times, the height sometimes changes to the actual size. What's wrong with my code? and my second question is about responsive in pixi.js. here is my code: var app = new PIXI.Application({ width: window.innerWidth, height: window.innerHeight, backgroundColor: 0x000000, antialias: true, //transparent: true, resizeTo: window.addEventListener("resize", function() { app.renderer.resize(window.innerWidth, window.innerHeight); }) }); as you can see I use resizeTo, but only the background of my pixi.js app is responsive. after changing the page size for rearranging the sprites I have to refresh the page.