Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In many cases we need to draw Rounded Rectangle but currently there a… #3548

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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.

None yet

2 participants