Fricken Hamster Posted November 14, 2013 Share Posted November 14, 2013 Would it be possible to do clipping, drawing only a part of an image in phaser? Link to comment Share on other sites More sharing options...
Mike Posted November 14, 2013 Share Posted November 14, 2013 Check this: Horizontal Crop, Vertical Crop and Dynamic Crop... they seem to miss assets in the online examples but locally they work for me.http://gametest.mobi/phaser/examples/_site/view_full.html?d=sprites&f=dynamic+crop.js&t=dynamic%20crop and crop documentation:http://gametest.mobi/phaser/docs/Phaser.Sprite.html#toc15 But maybe only rectangle shapes ... I don't know a way for a mask clipping with custom shapes... Link to comment Share on other sites More sharing options...
Fricken Hamster Posted November 14, 2013 Author Share Posted November 14, 2013 Yeah, I'd like to do it for a custom shape Link to comment Share on other sites More sharing options...
jcs Posted November 14, 2013 Share Posted November 14, 2013 Pixi supports masking against geometries (Pixi.Graphics objects).see http://www.goodboydigital.com/pixi-js-brings-canvas-and-webgl-masking for an explanation Link to comment Share on other sites More sharing options...
rich Posted November 15, 2013 Share Posted November 15, 2013 Yeah you can use .mask on any Phaser sprite too, just be aware of how incredibly slow it makes it when running in canvas. Link to comment Share on other sites More sharing options...
Recommended Posts