ccc.raphael icon indicating copy to clipboard operation
ccc.raphael copied to clipboard

Extension for cc.Graphics of Cocos Creator.

Results 5 ccc.raphael issues
Sort by recently updated
recently updated
newest added

Hi, thanks for your extension! I would like to know what are the steps to include ccc.raphael inside my Cocos Creator project :)

发现这个bug是因为我用到了group的层次,当旋转时子group没有绕自己的中心旋转,而是绕父group的中心旋转,一开始我就怀疑是矩阵串联反了,当时改了下updateTransform里面居然没有效果(后来发现我的用法确实走不到这儿),后来跟了下代码,并把每步的矩阵算出来看,发现走到: ```` getWorldTransform: function () { if (this.parent) { //return cc.affineTransformConcat(this.parent.getWorldTransform(), this.getTransform()); return cc.affineTransformConcat(this.getTransform(), this.parent.getWorldTransform()); } return this.getTransform(); }, ```` 这儿算出来的矩阵是错误的。然后把cc.affineTransformConcat的参数顺序改一下就对了。那么为什么呢?因为cocos creator不走寻常路,而且文档非常水,看一下他的实现和文档: ``` /** * !#en * Concatenate a transform...

getWorldBbox: function () { if (this._commands.worldBbox === undefined || this._transformDirty) { this._analysis(); } return this._commands.worldBbox; }, transform更新时,this._transformDirty会被置为false,因此boundingbox不会在transform更新后更新。解决这个问题,必须是transform更新时同时更新bounding box。但是我看了下,transform相关方法是mixin进来到path的,所以transform和bounding box是隔离的,不知道怎么改好了。 补充一下:我需要bounding box是为了做一个碰撞的优化,先使用bouding box检测,然后再使用另外一个库对path进行相交检测。如果ccc.raphael能直接支持更好了 再补充一下:水母的那个例子打开showboundingbox之后看到的boundingbox是正常更新的,但其实是因为那个例子在update里面调用了 this.path.points(this.pathPoints, true); this.path.smooth(); 把这两行都注掉就会发现水母还在动,但bounding box停在原地了 @2youyou2 作者你好!...