From 98fe1d46cc9074e65f2a222ebac3c6064ddf7069 Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 18 Dec 2015 00:32:59 +0300 Subject: [PATCH 1/4] Scale9Sprite now fully support cropped sprite frames in both mode simple & slice --- cocos/ui/UIScale9Sprite.cpp | 217 ++++++++++++------ cocos/ui/UIScale9Sprite.h | 5 +- .../CocoStudioGUITest/UIScale9SpriteTest.cpp | 94 +++++++- .../CocoStudioGUITest/UIScale9SpriteTest.h | 41 ++++ .../cpp-tests/Resources/Images/blocks9cr.png | Bin 0 -> 1208 bytes .../Resources/Images/blocks9ss.plist | 16 +- tests/cpp-tests/Resources/Images/blocks9с.png | Bin 0 -> 1191 bytes .../Resources/hd/Images/blocks9c.png | Bin 0 -> 4312 bytes .../Resources/hd/Images/blocks9cr.png | Bin 0 -> 2262 bytes .../Resources/hd/Images/blocks9r.png | Bin 0 -> 3141 bytes .../Resources/hd/Images/blocks9ss.plist | 16 +- 11 files changed, 297 insertions(+), 92 deletions(-) create mode 100644 tests/cpp-tests/Resources/Images/blocks9cr.png create mode 100644 tests/cpp-tests/Resources/Images/blocks9с.png create mode 100644 tests/cpp-tests/Resources/hd/Images/blocks9c.png create mode 100644 tests/cpp-tests/Resources/hd/Images/blocks9cr.png create mode 100644 tests/cpp-tests/Resources/hd/Images/blocks9r.png diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index aef00adf7a..dd10bd886c 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -454,6 +454,7 @@ namespace ui { _spriteFrameRotated = rotated; _originalSize = size; _preferredSize = size; + _offset = offset; _capInsetsInternal = capInsets; @@ -503,23 +504,31 @@ namespace ui { auto capInsets = CC_RECT_POINTS_TO_PIXELS(_capInsetsInternal); auto textureRect = CC_RECT_POINTS_TO_PIXELS(_spriteRect); - auto spriteRectSize = CC_SIZE_POINTS_TO_PIXELS(_originalSize); + auto spriteRectSize = _spriteRect.size; + auto originalSize = CC_SIZE_POINTS_TO_PIXELS(_originalSize); + auto offset = CC_POINT_POINTS_TO_PIXELS(_offset); + + Vec4 offsets; + offsets.x = offset.x + (originalSize.width - textureRect.size.width) / 2; + offsets.w = offset.y + (originalSize.height - textureRect.size.height) / 2; + offsets.z = originalSize.width - textureRect.size.width - offsets.x; + offsets.y = originalSize.height - textureRect.size.height - offsets.w; //handle .9.png if (_isPatch9) { - spriteRectSize = Size(spriteRectSize.width - 2, spriteRectSize.height-2); + originalSize = Size(originalSize.width - 2, originalSize.height-2); } if(capInsets.equals(Rect::ZERO)) { - capInsets = Rect(spriteRectSize.width/3, spriteRectSize.height/3, - spriteRectSize.width/3, spriteRectSize.height/3); + capInsets = Rect(originalSize.width/3, originalSize.height/3, + originalSize.width/3, originalSize.height/3); } - auto uv = this->calculateUV(tex, capInsets, spriteRectSize); - auto vertices = this->calculateVertices(capInsets, spriteRectSize); + auto uv = this->calculateUV(tex, capInsets, originalSize, offsets); + auto vertices = this->calculateVertices(capInsets, originalSize, offsets); auto triangles = this->calculateTriangles(uv, vertices); _scale9Image->getPolygonInfo().setTriangles(triangles); @@ -633,7 +642,7 @@ namespace ui { this->updateWithSprite(this->_scale9Image, _spriteRect, _spriteFrameRotated, - Vec2::ZERO, + _offset, _originalSize, capInsets); this->_insetLeft = capInsets.origin.x; @@ -1062,7 +1071,8 @@ namespace ui { // u0 u1 u2 u3 std::vector Scale9Sprite::calculateUV(Texture2D *tex, const Rect& capInsets, - const Size& spriteRectSize) + const Size& originalSize, + const Vec4& offsets) { auto atlasWidth = tex->getPixelsWide(); auto atlasHeight = tex->getPixelsHigh(); @@ -1073,23 +1083,46 @@ namespace ui { if (_spriteFrameRotated) { - rightWidth = capInsets.origin.y; + rightWidth = capInsets.origin.y - offsets.y; centerWidth = capInsets.size.height; - leftWidth = spriteRectSize.height - centerWidth - rightWidth; + leftWidth = originalSize.height - centerWidth - capInsets.origin.y - offsets.w; - topHeight = capInsets.origin.x; + topHeight = capInsets.origin.x - offsets.x; centerHeight = capInsets.size.width; - bottomHeight = spriteRectSize.width - (topHeight + centerHeight); + bottomHeight = originalSize.width - (capInsets.origin.x + centerHeight) - offsets.z; } else { - leftWidth = capInsets.origin.x; + leftWidth = capInsets.origin.x - offsets.x; centerWidth = capInsets.size.width; - rightWidth = spriteRectSize.width - (leftWidth + centerWidth); + rightWidth = originalSize.width - (capInsets.origin.x + centerWidth) - offsets.z; - topHeight = capInsets.origin.y; + topHeight = capInsets.origin.y - offsets.y; centerHeight = capInsets.size.height; - bottomHeight =spriteRectSize.height - (topHeight + centerHeight); + bottomHeight = originalSize.height - (capInsets.origin.x + centerHeight) - offsets.w; + } + + + if(leftWidth<0) + { + centerWidth += leftWidth; + leftWidth = 0; + } + if(rightWidth<0) + { + centerWidth += rightWidth; + rightWidth = 0; + } + + if(topHeight<0) + { + centerHeight += topHeight; + topHeight = 0; + } + if(bottomHeight<0) + { + centerHeight += bottomHeight; + bottomHeight = 0; } auto textureRect = CC_RECT_POINTS_TO_PIXELS(_spriteRect); @@ -1159,67 +1192,111 @@ namespace ui { //x0,y0-------------------- // x1 x2 x3 std::vector Scale9Sprite::calculateVertices(const Rect& capInsets, - const Size& spriteRectSize) + const Size& originalSize, + const Vec4& offsets) { - float leftWidth = 0, centerWidth = 0, rightWidth = 0; - float topHeight = 0, centerHeight = 0, bottomHeight = 0; - - leftWidth = capInsets.origin.x; - centerWidth = capInsets.size.width; - rightWidth = spriteRectSize.width - (leftWidth + centerWidth); - - topHeight = capInsets.origin.y; - centerHeight = capInsets.size.height; - bottomHeight = spriteRectSize.height - (topHeight + centerHeight); - - - leftWidth = leftWidth / CC_CONTENT_SCALE_FACTOR(); - rightWidth = rightWidth / CC_CONTENT_SCALE_FACTOR(); - topHeight = topHeight / CC_CONTENT_SCALE_FACTOR(); - bottomHeight = bottomHeight / CC_CONTENT_SCALE_FACTOR(); - float sizableWidth = _preferredSize.width - leftWidth - rightWidth; - float sizableHeight = _preferredSize.height - topHeight - bottomHeight; - float x0,x1,x2,x3; - float y0,y1,y2,y3; - if(sizableWidth >= 0) - { - x0 = 0; - x1 = leftWidth; - x2 = leftWidth + sizableWidth; - x3 = _preferredSize.width; - } - else - { - float xScale = _preferredSize.width / (leftWidth + rightWidth); - x0 = 0; - x1 = x2 = leftWidth * xScale; - x3 = (leftWidth + rightWidth) * xScale; - } - - if(sizableHeight >= 0) - { - y0 = 0; - y1 = bottomHeight; - y2 = bottomHeight + sizableHeight; - y3 = _preferredSize.height; - } - else - { - float yScale = _preferredSize.height / (topHeight + bottomHeight); - y0 = 0; - y1 = y2= bottomHeight * yScale; - y3 = (bottomHeight + topHeight) * yScale; - } - - std::vector vertices; + float offsetLeft = offsets.x / CC_CONTENT_SCALE_FACTOR(); + float offsetTop = offsets.y / CC_CONTENT_SCALE_FACTOR(); + float offsetRight = offsets.z / CC_CONTENT_SCALE_FACTOR(); + float offsetBottom = offsets.w / CC_CONTENT_SCALE_FACTOR(); + + std::vector vertices; if (_renderingType == RenderingType::SIMPLE) { - vertices = {Vec2(x0,y0), Vec2(x3,y3)}; + float hScale = _preferredSize.width / (originalSize.width / CC_CONTENT_SCALE_FACTOR()); + float vScale = _preferredSize.height / (originalSize.height / CC_CONTENT_SCALE_FACTOR()); + + vertices = {Vec2(offsetLeft * hScale, offsetBottom * vScale), + Vec2(_preferredSize.width - offsetRight * hScale, _preferredSize.height - offsetTop * vScale)}; } else { - vertices = {Vec2(x0,y0), Vec2(x1,y1), Vec2(x2,y2), Vec2(x3,y3)}; + float leftWidth = 0, centerWidth = 0, rightWidth = 0; + float topHeight = 0, centerHeight = 0, bottomHeight = 0; + + leftWidth = capInsets.origin.x; + centerWidth = capInsets.size.width; + rightWidth = originalSize.width - (leftWidth + centerWidth); + + topHeight = capInsets.origin.y; + centerHeight = capInsets.size.height; + bottomHeight = originalSize.height - (topHeight + centerHeight); + + leftWidth = leftWidth / CC_CONTENT_SCALE_FACTOR(); + rightWidth = rightWidth / CC_CONTENT_SCALE_FACTOR(); + centerWidth = centerWidth / CC_CONTENT_SCALE_FACTOR(); + topHeight = topHeight / CC_CONTENT_SCALE_FACTOR(); + bottomHeight = bottomHeight / CC_CONTENT_SCALE_FACTOR(); + centerHeight = centerHeight / CC_CONTENT_SCALE_FACTOR(); + + float sizableWidth = _preferredSize.width - leftWidth - rightWidth; + float sizableHeight = _preferredSize.height - topHeight - bottomHeight; + + leftWidth -= offsetLeft; + rightWidth -= offsetRight; + topHeight -= offsetTop; + bottomHeight -= offsetBottom; + + float hScale = sizableWidth / centerWidth; + float vScale = sizableHeight / centerHeight; + + if(leftWidth<0) + { + offsetLeft -= leftWidth * (hScale - 1.0f); + sizableWidth += leftWidth * hScale; + leftWidth = 0; + } + if(rightWidth<0) + { + sizableWidth += rightWidth * hScale; + rightWidth = 0; + } + if(topHeight<0) + { + sizableHeight += topHeight * vScale; + topHeight = 0; + } + if(bottomHeight<0) + { + offsetBottom -= bottomHeight * (vScale - 1.0f); + sizableHeight += bottomHeight * vScale; + bottomHeight = 0; + } + + float x0,x1,x2,x3; + float y0,y1,y2,y3; + if(sizableWidth >= 0) + { + x0 = offsetLeft; + x1 = x0 + leftWidth; + x2 = x1 + sizableWidth; + x3 = x2 + rightWidth; + } + else + { + float xScale = _preferredSize.width / (leftWidth + rightWidth); + x0 = offsetLeft; + x1 = x2 = offsetLeft + leftWidth * xScale; + x3 = x2 + rightWidth * xScale; + } + + if(sizableHeight >= 0) + { + y0 = offsetBottom; + y1 = y0 + bottomHeight; + y2 = y1 + sizableHeight; + y3 = y2 + topHeight; + } + else + { + float yScale = _preferredSize.height / (topHeight + bottomHeight); + y0 = offsetBottom; + y1 = y2 = y0 + bottomHeight * yScale; + y3 = y2 + topHeight * yScale; + } + + vertices = {Vec2(x0,y0), Vec2(x1,y1), Vec2(x2,y2), Vec2(x3,y3)}; } return vertices; } diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 4404ac9a64..1dc5d851e9 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -685,8 +685,8 @@ namespace ui { void applyBlendFunc(); void updateBlendFunc(Texture2D *texture); std::vector calculateUV(Texture2D *tex, const Rect& capInsets, - const Size& spriteRectSize); - std::vector calculateVertices(const Rect& capInsets, const Size& spriteRectSize); + const Size& originalSize, const Vec4& offsets); + std::vector calculateVertices(const Rect& capInsets, const Size& originalSize, const Vec4& offsets); TrianglesCommand::Triangles calculateTriangles(const std::vector& uv, const std::vector& vertices); @@ -701,6 +701,7 @@ namespace ui { /** Original sprite's size. */ Size _originalSize; + Vec2 _offset; /** Preferred sprite's size. By default the preferred size is the original size. */ //if the preferredSize component is given as -1, it is ignored diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index 4357efc8ef..70e38afe42 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -38,6 +38,10 @@ UIScale9SpriteTests::UIScale9SpriteTests() ADD_TEST_CASE(UIS9FrameNameSpriteSheetRotated); ADD_TEST_CASE(UIS9FrameNameSpriteSheetCropped); ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedRotated); + ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedImage); + ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedRotatedImage); + ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedSimple); + ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedRotatedSimple); ADD_TEST_CASE(UIS9BatchNodeScaledNoInsets); ADD_TEST_CASE(UIS9FrameNameSpriteSheetScaledNoInsets); ADD_TEST_CASE(UIS9FrameNameSpriteSheetRotatedScaledNoInsets); @@ -330,6 +334,8 @@ bool UIS9FrameNameSpriteSheetRotated::init() auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); + blocks->setPreferredSize(Size(400,80)); + blocks->setPosition(Vec2(x, y)); this->addChild(blocks); @@ -350,9 +356,8 @@ bool UIS9FrameNameSpriteSheetCropped::init() SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); - blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); + blocks->setPreferredSize(Size(400,80)); blocks->setPosition(Vec2(x, y)); - blocks->setCapInsets(Rect(5,5,5,5)); this->addChild(blocks); return true; @@ -371,9 +376,90 @@ bool UIS9FrameNameSpriteSheetCroppedRotated::init() SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9cr.png"); - blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); + blocks->setPreferredSize(Size(400,80)); + blocks->setPosition(Vec2(x, y)); + this->addChild(blocks); + + return true; + } + + return false; +} + +bool UIS9FrameNameSpriteSheetCroppedImage::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto blocks = Sprite::createWithSpriteFrameName("blocks9c.png"); + blocks->setScale(400/blocks->getContentSize().width, 80/blocks->getContentSize().height); + blocks->setPosition(Vec2(x, y)); + this->addChild(blocks); + + return true; + } + + return false; +} + +bool UIS9FrameNameSpriteSheetCroppedRotatedImage::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto blocks = Sprite::createWithSpriteFrameName("blocks9cr.png"); + blocks->setScale(400/blocks->getContentSize().width, 80/blocks->getContentSize().height); + blocks->setPosition(Vec2(x, y)); + this->addChild(blocks); + + return true; + } + + return false; +} + +bool UIS9FrameNameSpriteSheetCroppedSimple::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); + blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); + blocks->setPreferredSize(Size(400,80)); + blocks->setPosition(Vec2(x, y)); + this->addChild(blocks); + + return true; + } + + return false; +} + +bool UIS9FrameNameSpriteSheetCroppedRotatedSimple::init() +{ + if (UIScene::init()) { + auto winSize = Director::getInstance()->getWinSize(); + float x = winSize.width / 2; + float y = 0 + (winSize.height / 2); + + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); + + auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9cr.png"); + blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); + blocks->setPreferredSize(Size(400,80)); blocks->setPosition(Vec2(x, y)); - blocks->setInsetBottom(10); this->addChild(blocks); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h index 66e6d238df..8d6f872b15 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h @@ -91,6 +91,47 @@ public: virtual bool init() override; }; +// S9FrameNameSpriteSheetCropped + +class UIS9FrameNameSpriteSheetCroppedImage : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetCroppedImage); + + virtual bool init() override; +}; + +// S9FrameNameSpriteSheetCroppedRotated + +class UIS9FrameNameSpriteSheetCroppedRotatedImage : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetCroppedRotatedImage); + + virtual bool init() override; +}; + +// S9FrameNameSpriteSheetCropped + +class UIS9FrameNameSpriteSheetCroppedSimple : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetCroppedSimple); + + virtual bool init() override; +}; + +// S9FrameNameSpriteSheetCroppedRotated + +class UIS9FrameNameSpriteSheetCroppedRotatedSimple : public UIScene +{ +public: + CREATE_FUNC(UIS9FrameNameSpriteSheetCroppedRotatedSimple); + + virtual bool init() override; +}; + + // S9FrameNameSpriteSheetCropped class UIS9FrameNameSpriteSheetCropped : public UIScene diff --git a/tests/cpp-tests/Resources/Images/blocks9cr.png b/tests/cpp-tests/Resources/Images/blocks9cr.png new file mode 100644 index 0000000000000000000000000000000000000000..0f25bdc6b9564a102cad1fc7dcebd72b1ed51338 GIT binary patch literal 1208 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD3?#3*wSy!iOI#yLg7ec#$`gxH85~pclTsBt za}(23gHjVyDhp4h+AuIMt7L{mltlRYSS9D@>Lr5I=vCwv0Ch7k*w|MTBqnF4mMA2p zrf25aD!t#mUr8Y|#a1cY)Yrhbz&SM|)1#^=HMq(zB)KX(*)m1R-cG@$!U||WZfZ%Q zLPc&)Ua?h$trFN=DVPg@)As;uP=V3xw&xF#U(+h2=`(&xHzP;AXPso zwK%`DC>a=WY04n03ap%qQWHz^i$e1Ab6}wukda@KU!0L&px_*Arl8@Qn4Fmh63_(e z@b$Iw%quQQ%u7!7bg@+enxU7OnPO#XXy#~aVPJ0QVq|P+=xXX{=IrWd>}+A;YGCYU zZsY{h>yn>bnwy$e0@Is<&})HHFDNnO765H_NiE7OOHFYr%Fk5*d)g`!w_8kcng`XJ zg4-=-IQ8lS9itD5TBN9k2?5g&hzU=)Kn^_Vr{)3Edl4{UpPUh>4$Ksy0X`wF>R(>u zL@xXP|NrbI^MGPs)ZYTxMZdp)0CLz%g8YJkTp(bO@@94e3Vri*aSW-r^=8IHz7_?Z z=5mAgf8~D`bRH9KYKv@K!uzW@e%q#58u1%i7??N|8sNl((1x6#$ugq=%3u;`$@#S6YYiR}Gdf2Qr5>l)l5TXyl?8^&GC>)9{K3b?b>XmPO$Iy7)^cxSbX zS#~S4Eyu>eFL~{IV8GZg{hbVav^CLxyLDA`gsyiXDhzD8I0eed(`$rjpg`XXt3@ zecGHkYx;ZPGA`By)(^}p!x-xO%31%gNH8?rSdrMf`?3%)1Qblocks9c.png frame - {{103,189},{50,60}} + {{101,197},{58, 48}} offset - {13,18} + {15, -20} rotated sourceColorRect - {{0,0},{192,192}} + {{34, 44}, {58, 48}} sourceSize - {96,96} + {96, 96} blocks9cr.png frame - {{103,91},{50,60}} + {{71,89},{58, 48}} offset - {13,18} + {15, -20} rotated sourceColorRect - {{0,0},{96,96}} + {{34, 44}, {58, 48}} sourceSize - {96,96} + {96, 96} grossini_dance_01.png diff --git a/tests/cpp-tests/Resources/Images/blocks9с.png b/tests/cpp-tests/Resources/Images/blocks9с.png new file mode 100644 index 0000000000000000000000000000000000000000..39674a445c4d61bf25e0739168c8515514dde30c GIT binary patch literal 1191 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD3?#3*wSy!iOI#yLg7ec#$`gxH85~pclTsBt za}(23gHjVyDhp4h+AuIMt7L{mltlRYSS9D@>Lr5I=vCwv0Ch7k*w|MTBqnF4mMA2p zrf25aD!t#mUr8Y|#a1cY)Yrhbz&SM|)1#^=HMq(zB)KX(*)m1R-cG@$!U||WZfZ%Q zLPc&)Ua?h$trFN=DVPg@)As;uP=V3xw&xF#U(+h2=`(&xHzP;AXPso zwK%`DC>a=WY04n03ap%qQWHz^i$e1Ab6}wukda@KU!0L&px_*Arl8@Qn4Fmh63_(e z@b$Iw%quQQ%u7!7bg@+enxU7OnPO#XXy#~aVPI_OVq|P+=xXX{=IrWd>}+A;YGCYU zZsY{h>yn>bnwy$e0@Is<&})KIFDNnO765H_NiE7OOHFYr%Fk5*d)g`!w_6Nxng`XJ zg4-=dIQ8lS9itD5TBN9k2?5g&hzU=)Kn^_Vr{)3Edl4{UtF76t1k4md0X`wF>R(=b zQGfgY|Nq%b<^jckjDnu{A3zpcNswPKko*5X!{+@<_5(#;db&7_nzzf>WK}S*=jElHJs! zUMIezXWcHDSLfNzF#^s1pr8bP0l+XkK%S(?Q literal 0 HcmV?d00001 diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9c.png b/tests/cpp-tests/Resources/hd/Images/blocks9c.png new file mode 100644 index 0000000000000000000000000000000000000000..2dca8583566ca59580597fb48219b33f7f48ba3d GIT binary patch literal 4312 zcmd^CXIN8Pmkvdm(t8h~CP3&Qp-2k?N|7ciEhIrAC6GjED##TTQMiCeN08n{dPhXL zf*>GV1QEFO5_%+vflTnb-f!laasJJ(+0Qv=m$TNp-o47%&xx_KIm^x_!Ug~U*exy0 z>}h@H@y)_Od!p$xwP>9%0q#O@z9aK2S5;G2QKenl%4(W0Ep3>(4)E^= zqFKYCykYic=6~Cw%?v<31VSK8MI|^m7#ger#p152sOjqJ9%HDhE7K&D@u2|(M2K<# zUiv4385)noVFC#lYyj{W5#fcsPA~w`nEq=E{(=9%2H^j86U|{NA&5W~HK^+GmVOFa zTmSE({{H_+;|ccYfAjqxf$@%^foK(bG#+~$holA0Tl&~kAj}kpMi8(#M=aLwrx)#f zummjL2O9`9b+1ee_c$5+18J7c&^XKu zG|C)@^#}ggGz{}=F517u`&$?FYc4v!)K#I8Q8^Cne+u=_C0hO*5C2JA+T@?qM+eaI z9Y;%Smk8(-tzH0j=N;jCdU~|_NXbd(#-P&kvUqO6in19M((x*jO-&*NSw==iip&tPihNP((fgqR2<00ULUnR- zI#3|>^zaI{ytitzAB_*YVj3+@sK|F!iYHMrR^mU^JqKHIdZdpErN?ur8U_Gs!m7Yx8SeN# z_07)D=9cDT`Lz{RR(6H&TkQ5W`ISY_%L^o$ zUx2Cm5bD=RzMCCyUWu0H0S`$c`56@OSLx}IrLD!oOFQ`XN$N>r+v|?c-OD?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zY^qo|-Y(pSD^6B)%X9C4rbyL@i*itc+=7y6p-y0pQ zj!s;vSuSh9Fla29@mBQF`&#kvp1XF<%Iexn_fxEC?^!Ypu37gR-jf^3(}2s+T_Zu` zUIF=r8Gbv*uwueTx4U?vywE@;6;RhcZU!^* zQ5EVMYu|o55$LGqSar#vKL{ZJE%P07!s$uhVCq`nU;X;YLHzTu$TKCvk&&jInG#KEukdek&myc&o z`Dk=soCM??@fLTy<(i&8lMINd_a{BML#qPJ&?M`7n<{iqvIJ#RVsDkn0_IR1gn@1|Oj?jf; z%d*s^e=m5GAw6Y&?zb3!zEP{7GHq2=BdpN4c@6#YA*cSJ?U=Kp&&pv#%i~1Gebh$m zrTvf{!#^O}5nI9mSr=M`#odPR`pn~*oy*fGZ-KK{`30~3#kjS{p`Hj($QqEe80Vv9+3Kzx)-8Ri`?KF?s6A0 z2+3Y zmc7AHalsQE?j6iWGm+Fke$=#Q7~KYrHu4~JQW=E+2JREZA`?W=@jFYnjaj9MXViZH DQ~)z- literal 0 HcmV?d00001 diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9cr.png b/tests/cpp-tests/Resources/hd/Images/blocks9cr.png new file mode 100644 index 0000000000000000000000000000000000000000..f32d316174c7ac261b674e025f872c1ddf4fbd75 GIT binary patch literal 2262 zcmbtVYgiL!7M_4yE!T1p!G~!?lxh+Zk^qr3+!DD3As`o7gpdp*Kr%5INMNx>EDF*^ zR6u!9z=Bx36dQTtq7_qD0vg1k_b_LdEt+-5nVIu_-<k-wiW2ldx9x4t&|gtU%RP-lZMqmVE-5s`DH5a7j!6CluE#7%-Y z5SO2^^A_X*0NM`1@F*mT9Yo{7B0N_UgI9j7f7zzoOmjWSR0+b{a)3MW6+OVLI zPsc`5*v@Q;4=G{x9cz{e zSa2x>NugtZ6BWe{0exU81XA!WIG!_+2vVtdBAG&^5;uV)XCjHW;UJN4Xar7{Ax5|goLIJY znZXy5@uWftB80`DhLM{9ry+DKs`R%lh$J6q#j^LugdP|{!Icn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-LdjFVqwc2jNZ?ZkYJymg?QB ze?I7S3>`{%@#;{b$Shx)xtiWxuAOMo*O2PYUg7uC_p>gh^Nh`Vs26J^b<$qjzhj)k%FEA4n;FTEiM$R9V)YtYY>Jp0@28*|{UIZ44W6zn-aFb*?(* zjXHKL1fnaS72vi`+__QQawTp8%&*uJ>zUb7ET8WxGFQ7iblZMzV4Kg4Rh8QVvMorI z(QP+yO$4{YYV1g4kRs4vxik{M*%$y6)5)(C3*PbB{{alu Bo#6lg literal 0 HcmV?d00001 diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9r.png b/tests/cpp-tests/Resources/hd/Images/blocks9r.png new file mode 100644 index 0000000000000000000000000000000000000000..79c0c94604b8f993bcc153098e6610623659609e GIT binary patch literal 3141 zcmaJ@4Lp-;8-KRRe6{6UM=~SwF|#qUnJpn?%g2(J#PDE?ZMKOLR2^y&Ek;Jv(0U26f2U9-b$d^ z(0Cib7?y{K5BiJfj0n+=2**e?#Tn(4M3fW6fkGxKDK3^HASRK~pLvOLd&!MOqdtcS zcaYJ46%|PHL2cmjK@`E-787BE!=dc$t#Nh)dwZM}3U7nMV{PQ8JqBk-B-j)24yZ2& zTAqy`8AbGSb^nq}J|m-JghCz>i%m>Sv`)0O=JKPlI7dgvB@R3uBagrcc5#HvBn(Gj z{FT8K6h!b@JRytAK`k*d!?_7UGFo2gUrUJNeWT?FzHF0x!>~zA9u{Y9v$UkIfi&9x z4~>ia7A+9^fq&QgKZym5T|5x$2MV|e{0MpDqKubP@rWDvAXCWYGq~K?ue<0I!xeG` zFY+cQV zg#ZBA=;O_Bi~ZLb`SUR|Zzhw;%;qNxP8aLznESe<%$vFnM5add|KU>0S4AcLzyiWvvy4^;ZmfdwXjd>abWW=wE;}^)T#g z+0#@fOx|f~Zst1j;6ju5(TJ-->=k7bvf?roCw#~igL<+uiOc2A&d&A^4xFkwE$K8o zbm$NgiG*V;r)Q>3#)s6|p!T#gB6zD_-eI^tCYr7OY}{lS35l$?*3Q}oMIt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+mIj47b)IQ#LUq8AT9%D#<*2OFcF>KUS1m>8P$g@yy+8&}4rJoX89=FJrG{ABt}f3s(q%;#NjI7+%8*S= zmzAHCzD>W}QK;uvHP>_g(suEstwn+d!eMn_(~Fx#@yE)=p*_Bbsye1N>CJchd#oAx zp;ikJB>;05;HCWmHzHrom;;5aX_1K9Q7;Xke~9O`d~S2a#drF_NqfCV5s&+yzp>la zzObpHzq(XOmtZ4f;FxUWucDY;)#pZTCP^JX(L{@%RClOfjYX9UCEW9M&0|Fk2+=X}FvC8#R49Rm zCEg|luVee`0*JnQ5WT!-YgaK(N4UTSp4^%UU{glIW^N7a=@_R}%>VPdCs#>_(yI~x Z23*dbWsW~iomu*^_jIGX*1Cl4`wt|m7#RQn literal 0 HcmV?d00001 diff --git a/tests/cpp-tests/Resources/hd/Images/blocks9ss.plist b/tests/cpp-tests/Resources/hd/Images/blocks9ss.plist index 9f77a49011..4548217df5 100755 --- a/tests/cpp-tests/Resources/hd/Images/blocks9ss.plist +++ b/tests/cpp-tests/Resources/hd/Images/blocks9ss.plist @@ -33,28 +33,28 @@ blocks9c.png frame - {{204,374},{100,120}} + {{197,388}, {122, 102}} offset - {26,36} + {30, -41} rotated sourceColorRect - {{0,0},{192,192}} + {{65, 86}, {122, 102}} sourceSize - {192,192} + {192, 192} blocks9cr.png frame - {{204,180},{100,120}} + {{136,173}, {122, 102}} offset - {26,36} + {30, -41} rotated sourceColorRect - {{0,0},{192,192}} + {{65, 86}, {122, 102}} sourceSize - {192,192} + {192, 192} grossini_dance_01.png From 714c01991eca86b20e23f5ac60ae68e24f35f273 Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 18 Dec 2015 01:38:53 +0300 Subject: [PATCH 2/4] Scale9Sprite test improvemets --- .../CocoStudioGUITest/UIScale9SpriteTest.cpp | 68 ++++++------------ .../CocoStudioGUITest/UIScale9SpriteTest.h | 24 +------ .../cpp-tests/Resources/Images/blocks9cr.png | Bin 1208 -> 3808 bytes .../Resources/hd/Images/blocks9cr.png | Bin 2262 -> 4657 bytes 4 files changed, 25 insertions(+), 67 deletions(-) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp index 70e38afe42..dd5628d656 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp @@ -38,8 +38,6 @@ UIScale9SpriteTests::UIScale9SpriteTests() ADD_TEST_CASE(UIS9FrameNameSpriteSheetRotated); ADD_TEST_CASE(UIS9FrameNameSpriteSheetCropped); ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedRotated); - ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedImage); - ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedRotatedImage); ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedSimple); ADD_TEST_CASE(UIS9FrameNameSpriteSheetCroppedRotatedSimple); ADD_TEST_CASE(UIS9BatchNodeScaledNoInsets); @@ -357,9 +355,14 @@ bool UIS9FrameNameSpriteSheetCropped::init() auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); blocks->setPreferredSize(Size(400,80)); - blocks->setPosition(Vec2(x, y)); + blocks->setPosition(Vec2(x, y + 45)); this->addChild(blocks); + auto blocks2 = ui::Scale9Sprite::create("Images/blocks9c.png"); + blocks2->setPreferredSize(Size(400,80)); + blocks2->setPosition(Vec2(x, y - 45)); + this->addChild(blocks2); + return true; } @@ -377,48 +380,13 @@ bool UIS9FrameNameSpriteSheetCroppedRotated::init() auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9cr.png"); blocks->setPreferredSize(Size(400,80)); - blocks->setPosition(Vec2(x, y)); + blocks->setPosition(Vec2(x, y + 45)); this->addChild(blocks); - return true; - } - - return false; -} - -bool UIS9FrameNameSpriteSheetCroppedImage::init() -{ - if (UIScene::init()) { - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); - - auto blocks = Sprite::createWithSpriteFrameName("blocks9c.png"); - blocks->setScale(400/blocks->getContentSize().width, 80/blocks->getContentSize().height); - blocks->setPosition(Vec2(x, y)); - this->addChild(blocks); - - return true; - } - - return false; -} - -bool UIS9FrameNameSpriteSheetCroppedRotatedImage::init() -{ - if (UIScene::init()) { - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); - - auto blocks = Sprite::createWithSpriteFrameName("blocks9cr.png"); - blocks->setScale(400/blocks->getContentSize().width, 80/blocks->getContentSize().height); - blocks->setPosition(Vec2(x, y)); - this->addChild(blocks); + auto blocks2 = ui::Scale9Sprite::create("Images/blocks9cr.png"); + blocks2->setPreferredSize(Size(400,80)); + blocks2->setPosition(Vec2(x, y - 45)); + this->addChild(blocks2); return true; } @@ -438,9 +406,14 @@ bool UIS9FrameNameSpriteSheetCroppedSimple::init() auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); blocks->setPreferredSize(Size(400,80)); - blocks->setPosition(Vec2(x, y)); + blocks->setPosition(Vec2(x, y + 45)); this->addChild(blocks); + auto blocksSprite = Sprite::createWithSpriteFrameName("blocks9c.png"); + blocksSprite->setScale(400/blocksSprite->getContentSize().width, 80/blocksSprite->getContentSize().height); + blocksSprite->setPosition(Vec2(x, y - 45)); + this->addChild(blocksSprite); + return true; } @@ -459,9 +432,14 @@ bool UIS9FrameNameSpriteSheetCroppedRotatedSimple::init() auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9cr.png"); blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); blocks->setPreferredSize(Size(400,80)); - blocks->setPosition(Vec2(x, y)); + blocks->setPosition(Vec2(x, y + 45)); this->addChild(blocks); + auto blocksSprite = Sprite::createWithSpriteFrameName("blocks9cr.png"); + blocksSprite->setScale(400/blocksSprite->getContentSize().width, 80/blocksSprite->getContentSize().height); + blocksSprite->setPosition(Vec2(x, y - 45)); + this->addChild(blocksSprite); + return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h index 8d6f872b15..11042a7990 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.h @@ -91,27 +91,7 @@ public: virtual bool init() override; }; -// S9FrameNameSpriteSheetCropped - -class UIS9FrameNameSpriteSheetCroppedImage : public UIScene -{ -public: - CREATE_FUNC(UIS9FrameNameSpriteSheetCroppedImage); - - virtual bool init() override; -}; - -// S9FrameNameSpriteSheetCroppedRotated - -class UIS9FrameNameSpriteSheetCroppedRotatedImage : public UIScene -{ -public: - CREATE_FUNC(UIS9FrameNameSpriteSheetCroppedRotatedImage); - - virtual bool init() override; -}; - -// S9FrameNameSpriteSheetCropped +// S9FrameNameSpriteSheetCroppedSimple class UIS9FrameNameSpriteSheetCroppedSimple : public UIScene { @@ -121,7 +101,7 @@ public: virtual bool init() override; }; -// S9FrameNameSpriteSheetCroppedRotated +// S9FrameNameSpriteSheetCroppedRotatedSimple class UIS9FrameNameSpriteSheetCroppedRotatedSimple : public UIScene { diff --git a/tests/cpp-tests/Resources/Images/blocks9cr.png b/tests/cpp-tests/Resources/Images/blocks9cr.png index 0f25bdc6b9564a102cad1fc7dcebd72b1ed51338..beea86d7f8b02819a408787b44e0bb50a8a97092 100644 GIT binary patch literal 3808 zcmV<64j=J}P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#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08 +0300 Subject: [PATCH 3/4] =?UTF-8?q?change=D0=B2=20russian=20letter=20=D1=81=20?= =?UTF-8?q?to=20english=20c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/Images/{blocks9с.png => blocks9c.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/cpp-tests/Resources/Images/{blocks9с.png => blocks9c.png} (100%) diff --git a/tests/cpp-tests/Resources/Images/blocks9с.png b/tests/cpp-tests/Resources/Images/blocks9c.png similarity index 100% rename from tests/cpp-tests/Resources/Images/blocks9с.png rename to tests/cpp-tests/Resources/Images/blocks9c.png From 9e6657d6b26808f878760cc22994a9d0958f578a Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 18 Dec 2015 22:40:12 +0300 Subject: [PATCH 4/4] fix scale9error error --- cocos/ui/UIScale9Sprite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index dd10bd886c..914265a84f 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -1099,7 +1099,7 @@ namespace ui { topHeight = capInsets.origin.y - offsets.y; centerHeight = capInsets.size.height; - bottomHeight = originalSize.height - (capInsets.origin.x + centerHeight) - offsets.w; + bottomHeight = originalSize.height - (capInsets.origin.y + centerHeight) - offsets.w; }