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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.