#Cocos Creator# 用cc.rect创建Rect矩形
cc.rect中的xy参数是指哪个位置?
Cocos的文档有时候写的有点太简单了,比如cc.rect
对参数的描述完全没有用,作为有点健忘的中年程序员来说,真是有点为难。
/** !#en The convenience method to create a new Rect. see {{#crossLink "Rect/Rect:method"}}cc.Rect{{/crossLink}} !#zh 该方法用来快速创建一个新的矩形。{{#crossLink "Rect/Rect:method"}}cc.Rect{{/crossLink}} @param x x @param y y @param w w @param h h@example ```js var a = new cc.Rect(0 , 0, 10, 0); ``` */ export function rect(x?: number, y?: number, w?: number, h?: number): Rect;

做个笔记
这里的x和y指的是矩形的左下角,也就是origin,或者(minX, minY)。