Skip to content

ui::Text is not displayed (v3.17.2) #19992

Closed
@seventhrank

Description

@seventhrank
  • cocos2d-x version: 3.17.2 (C++)
  • devices test on: Android Nexus5
  • developing environments
    • NDK version: r19c
    • sdkbox IAP 2.4.3.3

ui::Text is not displayed at the "onSuccess" event after purchase (sdkbox IAP).

void ShopLayer::onSuccess(const Product &p)
{
    ui::Text *text = ui::Text::create();
    text->setPosition(Vec2(300.f, 300.f));
    text->setString("aaaaa");
    text->setFontSize(33);
    addChild(text);
}

It is displayed in 3.17.1

can work this issue below

void ShopLayer::onSuccess(const Product &p)
{
    scheduleOnce( [this](float f){
        ui::Text *text = ui::Text::create();
        text->setPosition(Vec2(300.f, 300.f));
        text->setString("aaaaa");
        text->setFontSize(33);
        addChild(text);
    }, 0.1f, "aaa");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions