From aaa5793b861ffe672168dcf71a2c3e34debe2423 Mon Sep 17 00:00:00 2001 From: fusijie Date: Mon, 3 Aug 2015 10:47:58 +0800 Subject: [PATCH] add IF-CASE to fix debug draw under SpriteBatchNode. --- cocos/2d/CCSprite.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 502c2deb66..d48ced1a8d 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -430,6 +430,10 @@ void Sprite::setTextureRect(const Rect& rect, bool rotated, const Size& untrimme void Sprite::debugDraw(bool on) { + if (_batchNode) { + log("Sprite doesn't support denbug draw when using SpriteBatchNode"); + return ; + } DrawNode* draw = getChildByName("debugDraw"); if(on) {