Diablo3093
Diablo3093

Reputation: 1063

Draw a RoundRect in easeljs

How to draw a rectangle in easeljs with only two rounded corners. I am doing this to get rounded corners in the bottom:

layout.graphics.beginStroke("black").drawRoundRect(100,100,100,100,0,0,5,5);

This is not drawing any rounded corners. Only this seems to be working:

layout.graphics.beginStroke("black").drawRoundRect(100,100,100,100,5);

Upvotes: 0

Views: 2252

Answers (1)

Lanny
Lanny

Reputation: 11294

Look into the drawRoundRectComplex method, instead of drawRoundRect: http://createjs.com/docs/easeljs/classes/Graphics.html#method_drawRoundRectComplex

drawRoundRectComplex(x, y, w, h, radiusTL, radiusTR, radiusBR, radiusBL);

Hope that helps.

Upvotes: 3

Related Questions