Neogene Posted February 8, 2015 Share Posted February 8, 2015 Hi folks, i'm trying to create a sniper viewfinder using Phaser, my idea was to 1) draw scene2) use a render texture to catpure a small area3) mask the render texture using a custom png shape. //inside "preload" this.load.image('mask', 'assets/mask-test2.png');//inside "create" var texture = game.add.renderTexture(300,300, 'content'); texture.resolution = 2; texture.scaleMode = Phaser.scaleModes.linear; game.add.sprite(300, 600, texture); //Mask var bmd = game.make.bitmapData(320, 256); bmd.alphaMask('content', 'mask');<- type error here game.add.image(300, 320, bmd).anchor.set(0.5, 0);//inside "update": texture.renderXY(gameGroup, -150,-150, true);There is an exception @ row 36556 in phaser latest version: if (typeof sourceRect === 'undefined' || sourceRect === null) { this.draw(source).blendReset(); //Uncaught TypeError: cannot read property 'blendReset' of undefined }So there is no way to mask a renderTexture? thank in advance. Link to comment Share on other sites More sharing options...
Recommended Posts