• Content Count

  • Joined

  • Last visited

  1. Is there any way to retrieve RenderTexture from the TextureManager? I create and save the RenderTextures to the TextureManager and would like to modify this textures later without keeping all the references. I store multiple RenderTextures as frames to minimize number of different textures. I've modified RenderTexture a bit to allow me to create it from existing texture/frame, but if that already exists, that would be even better. If it doesn't exist, I can make a pull request.
  2. This should be already fixed in the current dev version.
  3. Where are you testing? Which browser, which Phaser version? I've tried it with the dev version and it looks fine. Now you are drawing the rectangle with center on the position 100, 100. If you want to draw the top left corner at that position then change to this.add.image(100, 100, 'box').setOrigin(0)
  4. If you set the text origin to 0.5 and add it to the center (instead of the 0,0) of the background it should probably work.
  5. I have a few textures in different files and also prerender some things to a canvas and create textures out of it. I would like to reduce the number of webgl draws and now using a frame from a different texture creates another draw. Is there a plan to support multiple textures like in Phaser2 (multiTexture: true)?
  6. YuPi

    Rounded Rectangle

    I've added a pull request for rounded rectangle on Friday, but it hasn't been merged yet. If everything is ok, then it will probably be in the next version.
  7. With this code you just create a texture. To display it, you have to add an object that uses it to your scene. this.add.image(100, 100, 'gradient');
  8. Try upgrading your Phaser version. I've tried it on current beta and it works.
  9. var texture = this.textures.createCanvas('gradient', 16, 256); var context = texture.getContext(); var grd = context.createLinearGradient(0, 0, 0, 256); // ERROR LINE grd.addColorStop(0, '#8ED6FF'); grd.addColorStop(1, '#004CB3'); context.fillStyle = grd; context.fillRect(0, 0, 16, 256); // Call this if running under WebGL, or you'll see nothing change texture.refresh();
  10. Here are the examples: https://labs.phaser.io/index.html?dir=&q= and here is the documentation: https://photonstorm.github.io/phaser3-docs/list_class.html
  11. Instead of this.input.on... use: this.startText.on('pointerdown', function () { // this here refers to this.startText, so you can do e.g. this.setText("new text"); }) This works on Images, so I expect it to work also on text and other game objects.
  12. https://github.com/photonstorm/phaser3-docs/tree/master/typescript
  13. Looks like you've created the image, but forgot to add it to the scene. this.add.existing(this.´╗┐hero);
  14. I guess you have wrong context in onCompleteHandler(). Try changing onComplete: this.onCompleteHandler to onComplete: this.onCompleteHandler.bind(this)
  15. In Phaser 3 only Containers can contain other game objects, so in this case you are adding your graphics separately to the scene. When you call destroy(), only the text object is destroyed and the graphics remains as it is not "connected" to the text object. You could put both inside a container and then destroy container and it should destroy both text and graphics. Since you don't have many objects to put into container in this case, I think you should avoid it and just call another destroy on the graphics.