Skip to content

kamleshsharma/Cocos-Round-Rect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Cocos-Round-Rect

It is extension of cocos2d-x draw node class that can be used to make rounded rectangle. The library also runs fine if compiled for native platforms.

image

HOW TO USE IT:

Copy and paste Roundrect.js into your project and add it into your project.json file, Now you can use it any where. below are the few examples how to use this library to draw rounded corner rectangle.

Example:

var firstRoundRect = new RoundRect(width, height, bgColor, borderWidth, borderColor, borderRadius, type);
parent.addChild(firstRoundRect);

Arguments descriptions

@param {Number} [height] Hieght of rounded rectangle

@param {Number} [width] Width of rounded rectangle

@param {cc.Color|null} fillColor Fill color rounded rectangle else some default will be applied.

@param {Number} [lineWidth] Width of the border

@param {cc.Color|null} lineColor Line color rounded rectangle else some default will be applied.

@param {Number} [radiusWidth] Width of corner radius

@param {Number} [type] = Type of rounded rectangle i.e. TOP, BOTTOM, RIGHT, LEFT, If passed NULL all the corners will be rounded The possible values can be cc.DrawNode.RoundRectType.TOP // Only top side corners will be rounded cc.DrawNode.RoundRectType.BOTTOM // Only bottom side corners will be rounded cc.DrawNode.RoundRectType.RIGHT // Only right side corners will be rounded cc.DrawNode.RoundRectType.LEFT // Only left side corners will be rounded

Note:

The Above example works well when compile for native platform It has dependecies on cc.drawnode

Start Coding

Incase you face any difficulties or performance isssue with RoundRect.js, kindly report and issue

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published