auto sprite = Sprite::create(...);addChild(sprite);// 以下方法都会开启9宫格效果// 设置中间格子的区域,以normalized coordinates坐标。// 坐标范围:(0, 0) ~ (1, 1)// (0, 0):左上角// (1, 1):右下角sprite->setCenterRectNormalized( Rect( 0.4, 0.4, 0.2, 0.2 ) );// 设置中间格子的区域,以points coordinates,设计分辨率坐标。// CC_RECT_PIXELS_TO_POINTS 将像素坐标转换为设计分辨率下的坐标sprite->setCenterRect( CC_RECT_PIXELS_TO_POINTS( Rect( 6, 14, 2, 4 ) ) );sprite->setContentSize(......);
