mirror of https://github.com/axmolengine/axmol.git
update for cocos reader
This commit is contained in:
parent
807e63eae3
commit
fa85faec68
|
@ -519,7 +519,7 @@ namespace cocostudio
|
|||
auto layoutComponentTable = ((WidgetOptions*)nodeOptions)->layoutComponent();
|
||||
if (!layoutComponentTable) return;
|
||||
|
||||
auto layoutComponent = ui::LayoutComponent::boundingLayoutComponent(node);
|
||||
auto layoutComponent = ui::LayoutComponent::bindLayoutComponent(node);
|
||||
|
||||
bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled();
|
||||
bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled();
|
||||
|
|
|
@ -868,7 +868,7 @@ namespace cocostudio
|
|||
auto layoutComponentTable = ((WidgetOptions*)nodeOptions)->layoutComponent();
|
||||
if (!layoutComponentTable) return;
|
||||
|
||||
auto layoutComponent = ui::LayoutComponent::boundingLayoutComponent(node);
|
||||
auto layoutComponent = ui::LayoutComponent::bindLayoutComponent(node);
|
||||
|
||||
bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled();
|
||||
bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled();
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace ui {
|
|||
|
||||
}
|
||||
|
||||
LayoutComponent* LayoutComponent::boundingLayoutComponent(Node* node)
|
||||
LayoutComponent* LayoutComponent::bindLayoutComponent(Node* node)
|
||||
{
|
||||
LayoutComponent * layout = (LayoutComponent*)node->getComponent(__LAYOUT_COMPONENT_NAME);
|
||||
if (layout != nullptr)
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace ui {
|
|||
virtual bool init()override;
|
||||
CREATE_FUNC(LayoutComponent);
|
||||
|
||||
static LayoutComponent* boundingLayoutComponent(Node* node);
|
||||
static LayoutComponent* bindLayoutComponent(Node* node);
|
||||
|
||||
enum class HorizontalEdge
|
||||
{
|
||||
|
|
|
@ -755,25 +755,25 @@ bool UILayoutComponent_Berth_Test::init()
|
|||
if (UILayoutComponentTest::init())
|
||||
{
|
||||
Sprite* leftTopSprite = Sprite::create("cocosui/CloseSelected.png");
|
||||
LayoutComponent* leftTop = LayoutComponent::boundingLayoutComponent(leftTopSprite);
|
||||
LayoutComponent* leftTop = LayoutComponent::bindLayoutComponent(leftTopSprite);
|
||||
leftTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
|
||||
leftTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
|
||||
_baseLayer->addChild(leftTopSprite);
|
||||
|
||||
Sprite* leftBottomSprite = Sprite::create("cocosui/CloseSelected.png");
|
||||
LayoutComponent* leftBottom = LayoutComponent::boundingLayoutComponent(leftBottomSprite);
|
||||
LayoutComponent* leftBottom = LayoutComponent::bindLayoutComponent(leftBottomSprite);
|
||||
leftBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
|
||||
leftBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
|
||||
_baseLayer->addChild(leftBottomSprite);
|
||||
|
||||
Sprite* rightTopSprite = Sprite::create("cocosui/CloseSelected.png");
|
||||
LayoutComponent* rightTop = LayoutComponent::boundingLayoutComponent(rightTopSprite);
|
||||
LayoutComponent* rightTop = LayoutComponent::bindLayoutComponent(rightTopSprite);
|
||||
rightTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
|
||||
rightTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
|
||||
_baseLayer->addChild(rightTopSprite);
|
||||
|
||||
Sprite* rightBottomSprite = Sprite::create("cocosui/CloseSelected.png");
|
||||
LayoutComponent* rightBottom = LayoutComponent::boundingLayoutComponent(rightBottomSprite);
|
||||
LayoutComponent* rightBottom = LayoutComponent::bindLayoutComponent(rightBottomSprite);
|
||||
rightBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
|
||||
rightBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
|
||||
_baseLayer->addChild(rightBottomSprite);
|
||||
|
@ -791,7 +791,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init()
|
|||
{
|
||||
ImageView* leftTopSprite = ImageView::create("cocosui/CloseSelected.png");
|
||||
leftTopSprite->ignoreContentAdaptWithSize(false);
|
||||
LayoutComponent* leftTop = LayoutComponent::boundingLayoutComponent(leftTopSprite);
|
||||
LayoutComponent* leftTop = LayoutComponent::bindLayoutComponent(leftTopSprite);
|
||||
leftTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
|
||||
leftTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
|
||||
leftTop->setStretchWidthEnabled(true);
|
||||
|
@ -803,7 +803,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init()
|
|||
|
||||
ImageView* leftBottomSprite = ImageView::create("cocosui/CloseSelected.png");
|
||||
leftBottomSprite->ignoreContentAdaptWithSize(false);
|
||||
LayoutComponent* leftBottom = LayoutComponent::boundingLayoutComponent(leftBottomSprite);
|
||||
LayoutComponent* leftBottom = LayoutComponent::bindLayoutComponent(leftBottomSprite);
|
||||
leftBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
|
||||
leftBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
|
||||
leftBottom->setStretchWidthEnabled(true);
|
||||
|
@ -815,7 +815,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init()
|
|||
|
||||
ImageView* rightTopSprite = ImageView::create("cocosui/CloseSelected.png");
|
||||
rightTopSprite->ignoreContentAdaptWithSize(false);
|
||||
LayoutComponent* rightTop = LayoutComponent::boundingLayoutComponent(rightTopSprite);
|
||||
LayoutComponent* rightTop = LayoutComponent::bindLayoutComponent(rightTopSprite);
|
||||
rightTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
|
||||
rightTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
|
||||
rightTop->setStretchWidthEnabled(true);
|
||||
|
@ -827,7 +827,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init()
|
|||
|
||||
ImageView* rightBottomSprite = ImageView::create("cocosui/CloseSelected.png");
|
||||
rightBottomSprite->ignoreContentAdaptWithSize(false);
|
||||
LayoutComponent* rightBottom = LayoutComponent::boundingLayoutComponent(rightBottomSprite);
|
||||
LayoutComponent* rightBottom = LayoutComponent::bindLayoutComponent(rightBottomSprite);
|
||||
rightBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
|
||||
rightBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
|
||||
rightBottom->setStretchWidthEnabled(true);
|
||||
|
|
|
@ -1235,7 +1235,7 @@ void UILayoutComponentTest_Editor::configureGUIScene()
|
|||
|
||||
Text* back_label = Text::create("Back", "", 20);
|
||||
back_label->setTouchEnabled(true);
|
||||
auto labelLayout = LayoutComponent::boundingLayoutComponent(back_label);
|
||||
auto labelLayout = LayoutComponent::bindLayoutComponent(back_label);
|
||||
labelLayout->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
|
||||
labelLayout->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
|
||||
back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this));
|
||||
|
|
Loading…
Reference in New Issue