CCScaleTo和CCScaleBy的区别
CCScaleTo scales the node/sprite to an absolute scale factor while CCScaleBy scales it by a factor relative to current scale.
两者都是对节点或精灵进行缩放操作,区别为:CCScaleTo缩放到指定的绝对比例;CCScaleBy缩放到相对比例(即指定比例乘以当前比例)
For example, suppose a node currently has scale 0.25:
[CCScaleTo actionWithDuration:0.5 scale:2.0] will modify the scale to 2.0 (simply ignores the current scale)
[CCScaleBy actionWithDuration:0.5 scale:2.0] will modify the scale to 0.5 (0.25 * 2.0)
例如,假设节点的当前比例(即相对于原图已被缩放到的比例)为0.25:
CCScaleTo(动作执行时间0.5s, 比例2.0)将以2.0的比例缩放原图(简单的忽略当前已被缩放的比例);
CCScaleBy(动作执行时间0.5s, 比例2.0)将以0.5=0.25 x 2.0的比例缩放原图。