Skip to content

Conversation

kamleshsharma
Copy link

…re no such API available in cc.DrawNode class, So I have written a new method in cc.DrawNode class called as drawRoundRect for drawing rounded rectanglen which accepts arguments such as height , width , background color, border width, border color, radius and type. I am using this method to draw rounded rectangle in my game that is on production for past 2 years and it works well when compile it for andriod as well
Simple useage:
var myRoundRect = new cc.DrawNode();
myRoundRect.drawRoundRect(300,100,cc.color(255,0,0), 5, cc.color(255,255,255), 50);

image

see image for output reference.

Thanks

…re no such API available in cc.DrawNode class, So I have written a new method in cc.DrawNode class called as drawRoundRect for drawing rounded rectanglen which accepts arguments such as height , width , background color, border width, border color, radius and type. I am using this method to draw rounded rectangle in my game that is on production for past 2 years and it works well when compile it for andriod as well
@Dimon4eg
Copy link
Contributor

Dimon4eg commented Jan 27, 2018

Cool! I think also the same should be added to cocos2d-x repo using C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants