| 82 | } |
| 83 | |
| 84 | AlertLayer* AlertLayer::create(std::string_view title, std::string_view desc, std::string_view btn1, std::string_view btn2, float width, std::function<void(Node*)> btn1Callback, std::function<void(Node*)> btn2Callback) |
| 85 | { |
| 86 | auto pRet = new(std::nothrow) AlertLayer(); |
| 87 | |
| 88 | if (pRet && pRet->init(title, desc, btn1, btn2, width, btn1Callback, btn2Callback)) |
| 89 | { |
| 90 | pRet->autorelease(); |
| 91 | return pRet; |
| 92 | } |
| 93 | else |
| 94 | { |
| 95 | AX_SAFE_DELETE(pRet); |
| 96 | return nullptr; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | AlertLayer* AlertLayer::create(std::string_view title, std::string_view desc, std::string_view btn1, std::string_view btn2, std::function<void(Node*)> btn1Callback, std::function<void(Node*)> btn2Callback) { |
| 101 | return AlertLayer::create(title, desc, btn1, btn2, 500, btn1Callback, btn2Callback); |