Jump to content

Sprite From BitmapData Circle


UseTheForceFrodo
 Share

Recommended Posts

Hey guys, just a simple question about one of the examples on the website, specifically the Sprite From BitmapData example.

 

I love the interactivity on Phaser.io with its Sandbox and editable examples. I've found myself interested in attaching primitives as textures to sprites and found the Sprite From BitmapData example. What I want to do is simply change the red square to a red circle. I tried doing so by changing this line of code:

bmd.ctx.rect(0,0,128,128);

to this:

bmd.ctx.circle(0,0,64);

Every other line has remained the same. 

 
The result I expected is a red circle with a radius of 64px in the same location as the red square/rectangle (a simple shape replacement). The results observed however are a complete black and/or empty canvas. Nothing at all.

Am I doing something wrong? Does anyone else have any issues changing the square in the Sprite From BitmapData example to a circle?

Many thanks!
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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