@@ -208,11 +208,11 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
208
208
* Constructor function. override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
209
209
* @function
210
210
* @param {string|cc.SpriteFrame } file file name of texture or a SpriteFrame
211
- * @param {cc.Rect } rect
211
+ * @param {cc.Rect } rectOrCapInsets
212
212
* @param {cc.Rect } capInsets
213
213
* @returns {Scale9Sprite }
214
214
*/
215
- ctor : function ( file , rect , capInsets ) {
215
+ ctor : function ( file , rectOrCapInsets , capInsets ) {
216
216
cc . Node . prototype . ctor . call ( this ) ;
217
217
this . _spriteRect = cc . rect ( 0 , 0 , 0 , 0 ) ;
218
218
this . _capInsetsInternal = cc . rect ( 0 , 0 , 0 , 0 ) ;
@@ -224,13 +224,13 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
224
224
225
225
if ( file != undefined ) {
226
226
if ( file instanceof cc . SpriteFrame )
227
- this . initWithSpriteFrame ( file , rect ) ;
227
+ this . initWithSpriteFrame ( file , rectOrCapInsets ) ;
228
228
else {
229
229
var frame = cc . spriteFrameCache . getSpriteFrame ( file ) ;
230
230
if ( frame != null )
231
- this . initWithSpriteFrame ( frame , rect ) ;
231
+ this . initWithSpriteFrame ( frame , rectOrCapInsets ) ;
232
232
else
233
- this . initWithFile ( file , rect , capInsets ) ;
233
+ this . initWithFile ( file , rectOrCapInsets , capInsets ) ;
234
234
}
235
235
} else {
236
236
this . init ( ) ;
0 commit comments