Skip to content

Commit 43dc6b5

Browse files
committed
Merge pull request #207 from NatWeiss/patch-1
Mimic HTML5 cc.p()
2 parents 955c432 + 768cd91 commit 43dc6b5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frameworks/js-bindings/bindings/script/jsb_cocos2d.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ cc._reuse_color4b = {r:255, g:255, b:255, a:255 };
118118
//
119119
cc.p = function( x, y )
120120
{
121+
if (x == undefined)
122+
return {x: 0, y: 0};
123+
if (y == undefined)
124+
return {x: x.x, y: x.y};
121125
return {x:x, y:y};
122126
};
123127
cc._p = function( x, y )

0 commit comments

Comments
 (0)