Jump to content

Smooth Masks


Maethalion
 Share

Recommended Posts

I'm trying to use Phaser (2.6.2) to mask an image.  I need a circle, but the circle drawn has very jagged edges.

How can I get a smoother circle?  I've tried `drawArc`, `drawCircle`, and drawing a smaller circle but scaling up (for intentional scaling artifacts)

Pasting this into http://phaser.io/sandbox/edit/1 illustrates it pretty clearly

function create() {
    var game = this.game
    
    var graphics2 = game.add.graphics(0, 0);
    graphics2.beginFill(0x0000FF, 1)
    graphics2.drawCircle(0, 0, 100)
    graphics2.scale.set(12)
    
    var graphics = game.add.graphics(0, 0);

    graphics.beginFill(0x00FF00, 1)
    graphics.arc(0, 0, 500, game.math.degToRad(0), game.math.degToRad(360), false);


    graphics.beginFill(0xFF0000, 1);
    graphics.drawCircle(0, 0, 800);
    
   
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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