charlie_says

How to achieve blendmode type operations with Phaser 3 textures

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?

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.