Jump to content

How to achieve blendmode type operations with Phaser 3 textures


charlie_says
 Share

Recommended Posts

For a project I'm working, using Phaser 2, I'm using BitmapData doing something like this: 

var _icon_bmd = new Phaser.BitmapData(bmd_bg.width, bmd_bg.height, true, color);
_icon_bmd.draw(bmd_bg, 0,0, bmd_bg.width, bmd_bg.height, BlendMode.ALPHA, true); // makes a circular shape
_icon_bmd.draw(bmd_icon, 0,0, bmd_bg.width, bmd_bg.height, BlendMode.ERASE, true); // removes an icon from the circle

var _icon = new Phaser.Bitmap(_icon_bmd);

(This is kind of reworked/untested to put in here, but it is directly inline with what I'm doing).

I had a brief moment when I thought about porting to Phaser 3. When I found that BitmapData wasn't used any more, and with the time constraints, I decided to leave it.

But, for the future, I would like to know how to do this (or if I can).

So, can anyone help me out a little? Is this kind of thing possible with Phaser 3?

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...