Jump to content

How to create rounded corner rectangle?


mungur
 Share

Recommended Posts

Hello,
I'm pretty new in js games & phaser.io so my question may be little bit silly, but ..  

Whats the best way to create rounded rectangle?

There is no way to create curves or arcs with Graphics class. Or there is a way?
Only way I can think is to load high res. tilesprite with all rectangles and then downscale depending on screen resolution.



 

Link to comment
Share on other sites

  • 2 years later...
  • 7 months later...
On 25. 7. 2016 at 11:11 PM, Adibas03 said:

I know this is old now.

I just wanted to give update.

Function now exists for graphics in Phaserjs as from version 2.5.0


graphics.drawRoundedRectangle(x,y,width,height,angle)

 

it's actually a method that is inherited from Pixi.Graphics.  It has been changed to graphics.drawRoundedRect(x, y, width, height, radius)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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