• Content Count

  • Joined

  • Last visited

  1. Hello I was wondering if its possible to use the standard browser file select (like choosing an image from my PC) and setting that as a phaserjs sprite. Is that possible ? I could not find any examples ! Best regards !
  2. I have an app thats a mix of phaser an react. Im loading some images as follows: this.load.image('bone', 'assets/images/bone.png'); How would it be possible to dynamically get the image of a sprite, and render into html ? Something like (example) const image = sprite.image; return <img src={image}/> Is that somehow possible ? Also, is listing images possible ? (get all loaded images) What im tryng to achieve is a panel that shows the sprite image, and you could change the sprite image to another image (maye even choosing an image from your pc) Thanks for any help !
  3. I have some joints and some connected joints to those joints. What i want to achieve is, move the connected joints whenever a father is moved, but it seems the child joint is moving more then the father joint. This is my drag update function: onDragUpdate(e) { if(this.connectedJoints.length > 0) { const differenceX = e.position.x - e.previousPosition.x; const differenceY = e.position.y - e.previousPosition.y; this.connectedJoints.forEach(joint => { joint.sprite.x += differenceX; joint.sprite.y += differenceY; }); } It appears the connected joint moves more then the original joint. Any ideas why is this wrong ?? Best regards
  4. Hi. Ill implement a simple animator (somehow simillar to Pivot) on Phaserjs and i wish i could have some guidelines from you guys =P The first thing is, the drag and drop axis (circles). Should them be a sprite ? Or each of them a Graphics object handled by the scene ? What would be easyer/more performatic ? The second is image streching, is it ok to make it real time ? Does that affect performance somehow ? Thanks for your attention !
  5. Hello there. I'm making a simple game to understand phaser better. I have made a simple game using this resolution: phaserGame = new Phaser.Game(480, 720, Phaser.AUTO, ''); So, i can center this on screen etc. However, if i wish the game to be resized to fit the screen in desktop and mobile devices, what would be the best way to do ? Thanks again for any attention