You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classExampleextendsPhaser.Scene{preload(){this.load.image('mario-tiles','assets/tilemaps/tiles/super-mario.png');}create(){this.add.text(0,66,'Default');this.add.text(80,66,'Render\nTexture');// Load a map from a 2D array of tile indicesconstlevel=[[0,0,0,0],[0,0,0,39],[39,39,39,39],[39,39,39,39],];// When loading from an array, make sure to specify the tileWidth and tileHeightconstmap=this.make.tilemap({data: level,tileWidth: 16,tileHeight: 16});consttiles=map.addTilesetImage('mario-tiles');constlayer=map.createLayer(0,tiles,0,0);constcontainer=this.add.container(7,20);constimg=this.add.image(0,-16,'mario-tiles');img.setCrop(0,16,16,16);img.setOrigin(0,0);img.blendMode=Phaser.BlendModes.ADD;constimg2=this.add.image(-12,-14,'mario-tiles');img2.setCrop(32,16,16,16);img2.setOrigin(0,0);container.add(img);container.add(img2);consttexture=this.add.renderTexture(80,0,64,64);texture.setOrigin(0,0);texture.draw(layer);texture.draw(container);}}constconfig={type: Phaser.AUTO,width: 11*16,// Number of tiles * size of the tileheight: 10*16,zoom: 4,parent: 'phaser-example',pixelArt: true,scene: Example};constgame=newPhaser.Game(config);
Additional Information
They should look the same
The text was updated successfully, but these errors were encountered:
Version
Description
When drawing a container with multiple images into a
RenderTexture
, theblendMode
is not set correctly. The images all have differentblendModes
Example Test Code
Code is based on this sandbox: https://labs.phaser.io/edit.html?src=src\tilemap\create%20from%20array.js
Additional Information
They should look the same
The text was updated successfully, but these errors were encountered: