charlie_says

Bitmapdata example not working in typescript

Recommended Posts

Hi,

I'm trying to do something similar to this example:

https://phaser.io/examples/v2/bitmapdata/radial-gradient

 

But, I'm working in TypeScript, and it doesn't 'like' the last part:

    bmd.circle(outerCircle.x, outerCircle.y, outerCircle.radius, grd);

gets me the error:

Argument of type 'CanvasGradient' is not assignable to parameter of type 'string'.

Any ideas how I resolve this?

Share this post


Link to post
Share on other sites

ok, should anyone come across this, and be interested, I've fixed it by drawing directly to the context. What I was trying to do was a little different, so it's not a straight replacement of the above.

bmd.context.fillStyle = grd;
bmd.context.fillRect(0,0,this.game.width,this.game.height);
 

 

 

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.