trinity420

Members
  • Content Count

    6
  • Joined

  • Last visited

  1. No, does not work. With "-1" the sprites are not even created. Also the documentation says "use null for no replacement". Strange that this happens only with one group/layer.
  2. Hey, I use a tiled map for my game. I create sprites from tiles using the command "map.creteFromTiles(<tile ID>, null, 'image', 'solidLayer', blockGroup);". The sprites are created and when I move or tween the sprites, it works fine the sprites move as they should. BUT the tile where the sprite was created from is still there. I can't find it with map.getTile() so I think it's kind of an artifact left and not removed. I think this problem is new, it does not appear with my other groups that I create in the same way. How can I solve this? Thank you!
  3. Just use: sprite.frame === 3 // read current frame sprite.frame = 5 // set frame Worked for me!
  4. You can use sprite.animations.currentAnim.name. Worked for me!
  5. Oh, my error, I forgot to load the corresponding tileset with Phaser! Warning is still there but the rendering error is gone, so it works now!
  6. I want to use a spritesheet with 1283x654 pixels in my game. I embedded the spritesheet in the Tiled Editor into my level. When loading I get this warning: Phaser.Tileset - tiles2 image tile area is not an even multiple of tile size And when trying to render I get this error: phaser.js:98606 Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)' at Phaser.Tileset.draw (phaser.js:98606) at Phaser.TilemapLayer.renderRegion (phaser.js:97327) at Phaser.TilemapLayer.renderFull (phaser.js:97449) at Phaser.TilemapLayer.render (phaser.js:97524) at Phaser.TilemapLayer._renderWebGL (phaser.js:96753) at Phaser.World.PIXI.DisplayObjectContainer._renderWebGL (phaser.js:15090) at Phaser.Stage.PIXI.DisplayObjectContainer._renderWebGL (phaser.js:15090) at PIXI.WebGLRenderer.renderDisplayObject (phaser.js:17398) at PIXI.WebGLRenderer.render (phaser.js:17364) at Phaser.Game.updateRender (phaser.js:36223) My map and objects consist of 16x16 pixel tiles. So I tried to resize the spritesheet to 2048x1024 pixels which is a "even multiple of tile size", when the tile size is 16 pixels. But the warning and error are still the same. Notice that the spritesheets has a 1px separation between tiles! I also tried resizing to an even multiple of 17 pixels. Same error. How do I have to resize the image/spritesheet to get it to work? I gues it has something to do with the 1px separtion? Thank you (spritesheet is attached)