mirror of https://github.com/axmolengine/axmol.git
Fix #908
This commit is contained in:
parent
fe172f4254
commit
fb227f352f
|
@ -309,7 +309,7 @@ bool UIS9FrameNameSpriteSheetRotated::init()
|
||||||
|
|
||||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
||||||
|
|
||||||
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ bool UIS9FrameNameSpriteSheetCropped::init()
|
||||||
|
|
||||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
||||||
|
|
||||||
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png");
|
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9c.png");
|
||||||
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
||||||
blocks->setPosition(Vec2(x, y + 45));
|
blocks->setPosition(Vec2(x, y + 45));
|
||||||
this->addChild(blocks);
|
this->addChild(blocks);
|
||||||
|
@ -359,7 +359,7 @@ bool UIS9FrameNameSpriteSheetCroppedRotated::init()
|
||||||
|
|
||||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
||||||
|
|
||||||
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9cr.png");
|
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9cr.png");
|
||||||
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
||||||
blocks->setPosition(Vec2(x, y + 45));
|
blocks->setPosition(Vec2(x, y + 45));
|
||||||
this->addChild(blocks);
|
this->addChild(blocks);
|
||||||
|
@ -385,13 +385,13 @@ bool UIS9FrameNameSpriteSheetCroppedSimple::init()
|
||||||
|
|
||||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
||||||
|
|
||||||
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png");
|
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9c.png");
|
||||||
blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
||||||
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
||||||
blocks->setPosition(Vec2(x, y + 45));
|
blocks->setPosition(Vec2(x, y + 45));
|
||||||
this->addChild(blocks);
|
this->addChild(blocks);
|
||||||
|
|
||||||
auto blocksSprite = Sprite::createWithSpriteFrameName("blocks9c.png");
|
auto blocksSprite = Sprite::createWithSpriteFrameName("blocks9ss/blocks9c.png");
|
||||||
blocksSprite->setScale(400 / blocksSprite->getContentSize().width, 80 / blocksSprite->getContentSize().height);
|
blocksSprite->setScale(400 / blocksSprite->getContentSize().width, 80 / blocksSprite->getContentSize().height);
|
||||||
blocksSprite->setPosition(Vec2(x, y - 45));
|
blocksSprite->setPosition(Vec2(x, y - 45));
|
||||||
this->addChild(blocksSprite);
|
this->addChild(blocksSprite);
|
||||||
|
@ -412,13 +412,13 @@ bool UIS9FrameNameSpriteSheetCroppedRotatedSimple::init()
|
||||||
|
|
||||||
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
|
||||||
|
|
||||||
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9cr.png");
|
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9cr.png");
|
||||||
blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
|
||||||
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
blocks->setPreferredSize(Size(400.0f, 80.0f));
|
||||||
blocks->setPosition(Vec2(x, y + 45));
|
blocks->setPosition(Vec2(x, y + 45));
|
||||||
this->addChild(blocks);
|
this->addChild(blocks);
|
||||||
|
|
||||||
auto blocksSprite = Sprite::createWithSpriteFrameName("blocks9cr.png");
|
auto blocksSprite = Sprite::createWithSpriteFrameName("blocks9ss/blocks9cr.png");
|
||||||
blocksSprite->setScale(400 / blocksSprite->getContentSize().width, 80 / blocksSprite->getContentSize().height);
|
blocksSprite->setScale(400 / blocksSprite->getContentSize().width, 80 / blocksSprite->getContentSize().height);
|
||||||
blocksSprite->setPosition(Vec2(x, y - 45));
|
blocksSprite->setPosition(Vec2(x, y - 45));
|
||||||
this->addChild(blocksSprite);
|
this->addChild(blocksSprite);
|
||||||
|
@ -484,7 +484,7 @@ bool UIS9FrameNameSpriteSheetRotatedScaledNoInsets::init()
|
||||||
float x = winSize.width / 2;
|
float x = winSize.width / 2;
|
||||||
float y = 0 + (winSize.height / 2);
|
float y = 0 + (winSize.height / 2);
|
||||||
|
|
||||||
auto blocks_scaled = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto blocks_scaled = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
blocks_scaled->setPosition(Vec2(x, y));
|
blocks_scaled->setPosition(Vec2(x, y));
|
||||||
|
|
||||||
|
@ -575,7 +575,7 @@ bool UIS9FrameNameSpriteSheetRotatedInsets::init()
|
||||||
float x = winSize.width / 2;
|
float x = winSize.width / 2;
|
||||||
float y = 0 + (winSize.height / 2);
|
float y = 0 + (winSize.height / 2);
|
||||||
|
|
||||||
auto blocks_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png", Rect(32, 32, 32, 32));
|
auto blocks_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png", Rect(32, 32, 32, 32));
|
||||||
|
|
||||||
blocks_with_insets->setPosition(Vec2(x, y));
|
blocks_with_insets->setPosition(Vec2(x, y));
|
||||||
|
|
||||||
|
@ -652,7 +652,7 @@ bool UIS9FrameNameSpriteSheetRotatedSetCapInsetLater::init()
|
||||||
float x = winSize.width / 2;
|
float x = winSize.width / 2;
|
||||||
float y = 0 + (winSize.height / 2);
|
float y = 0 + (winSize.height / 2);
|
||||||
|
|
||||||
auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
blocks_scaled_with_insets->setInsetLeft(32);
|
blocks_scaled_with_insets->setInsetLeft(32);
|
||||||
blocks_scaled_with_insets->setInsetRight(32);
|
blocks_scaled_with_insets->setInsetRight(32);
|
||||||
|
@ -680,7 +680,7 @@ bool UIS9CascadeOpacityAndColor::init()
|
||||||
rgba->setCascadeOpacityEnabled(true);
|
rgba->setCascadeOpacityEnabled(true);
|
||||||
this->addChild(rgba);
|
this->addChild(rgba);
|
||||||
|
|
||||||
auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
blocks_scaled_with_insets->setPosition(Vec2(x, y));
|
blocks_scaled_with_insets->setPosition(Vec2(x, y));
|
||||||
|
|
||||||
|
@ -708,12 +708,12 @@ bool UIS9ZOrder::init()
|
||||||
float x = winSize.width / 2;
|
float x = winSize.width / 2;
|
||||||
float y = 0 + (winSize.height / 2);
|
float y = 0 + (winSize.height / 2);
|
||||||
|
|
||||||
auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
blocks_scaled_with_insets->setPosition(Vec2(x, y));
|
blocks_scaled_with_insets->setPosition(Vec2(x, y));
|
||||||
this->addChild(blocks_scaled_with_insets);
|
this->addChild(blocks_scaled_with_insets);
|
||||||
|
|
||||||
Sprite* normalSprite = Sprite::createWithSpriteFrameName("blocks9r.png");
|
Sprite* normalSprite = Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
normalSprite->setColor(Color3B::RED);
|
normalSprite->setColor(Color3B::RED);
|
||||||
blocks_scaled_with_insets->addChild(normalSprite);
|
blocks_scaled_with_insets->addChild(normalSprite);
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ bool UIS9Flip::init()
|
||||||
statusLabel->setPosition(Vec2(x, winSize.height - statusLabel->getContentSize().height - 40));
|
statusLabel->setPosition(Vec2(x, winSize.height - statusLabel->getContentSize().height - 40));
|
||||||
this->addChild(statusLabel);
|
this->addChild(statusLabel);
|
||||||
|
|
||||||
auto normalSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto normalSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
normalSprite->setPosition(Vec2(x, y));
|
normalSprite->setPosition(Vec2(x, y));
|
||||||
this->addChild(normalSprite);
|
this->addChild(normalSprite);
|
||||||
|
@ -755,7 +755,7 @@ bool UIS9Flip::init()
|
||||||
Vec2(0.0f, normalSprite->getContentSize().height / 2 + 10));
|
Vec2(0.0f, normalSprite->getContentSize().height / 2 + 10));
|
||||||
this->addChild(normalLabel);
|
this->addChild(normalLabel);
|
||||||
|
|
||||||
auto flipXSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto flipXSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
flipXSprite->setPosition(Vec2(x - 120, y));
|
flipXSprite->setPosition(Vec2(x - 120, y));
|
||||||
flipXSprite->setScale(1.2f);
|
flipXSprite->setScale(1.2f);
|
||||||
|
@ -766,7 +766,7 @@ bool UIS9Flip::init()
|
||||||
flipXLabel->setPosition(flipXSprite->getPosition() + Vec2(0.0f, flipXSprite->getContentSize().height / 2 + 10));
|
flipXLabel->setPosition(flipXSprite->getPosition() + Vec2(0.0f, flipXSprite->getContentSize().height / 2 + 10));
|
||||||
this->addChild(flipXLabel);
|
this->addChild(flipXLabel);
|
||||||
|
|
||||||
auto flipYSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto flipYSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
|
|
||||||
flipYSprite->setPosition(Vec2(x + 120, y));
|
flipYSprite->setPosition(Vec2(x + 120, y));
|
||||||
this->addChild(flipYSprite);
|
this->addChild(flipYSprite);
|
||||||
|
@ -874,7 +874,7 @@ bool UIS9ChangeAnchorPoint::init()
|
||||||
float x = winSize.width / 2;
|
float x = winSize.width / 2;
|
||||||
float y = 0 + (winSize.height / 2 + 50);
|
float y = 0 + (winSize.height / 2 + 50);
|
||||||
|
|
||||||
auto normalSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
|
auto normalSprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
|
||||||
normalSprite->setPosition(Vec2(x, y));
|
normalSprite->setPosition(Vec2(x, y));
|
||||||
// normalSprite->setScale9Enabled(false);
|
// normalSprite->setScale9Enabled(false);
|
||||||
// normalSprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT);
|
// normalSprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT);
|
||||||
|
|
Loading…
Reference in New Issue