0
cocos2d-js 게임용 chipmunk physics 엔진을 구현하려고합니다. 내가 실행할 때 다음과 같은 오류가 발생합니다. 여기 cocos2d-js : 오류 : setPhysicsBody를 사용한 잘못된 네이티브 오브젝트
jsb: ERROR: File Y:\Documents\cocos\PrebuiltRuntimeJs\frameworks\js-bindings\bindings\auto\jsb_cocos2dx_auto.cpp: Line: 2143, Function: js_cocos2dx_Node_setPhysicsBody Invalid Native Object JS: D:/PROJECTS/cocos/Sliderule/runtime/win32/../../src/app.js:32:Error: Invalid Native Object
은 스프라이트에 몸을 설정할 때 내가 문제를 얻을 내가
`init:function() { this._super(); var size = cc.winSize; this.rect1 = new cc.Sprite(res.null_png,cc.rect(0,0, 200, 25)); this.rect1.setColor(cc.color(255,50,50,1)); this.rect1.setPosition(size.width/2, size.height-12.5); this.rect1._setAnchorX(0.5); this.rect1._setAnchorY(0.5); this.rectbody1 = new cp.Body(1,cp.momentForBox(1,this.rect1.getContentSize().width, this.rect1.getContentSize().height)); this.rectbody1.p = cc.p(size.width/2, size.height-12.5); this.space.addBody(this.rectbody1); this.rectshape1 = new cp.BoxShape(this.rectbody1, this.rect1.getContentSize().width - 14, this.rect1.getContentSize().height); this.space.addShape(this.rectshape1); this.rect1.setPhysicsBody(this.rectbody1); this.addChild(this.rect1,1); `
함께 일하고 있어요 코드입니다. 미리 감사드립니다.