| 36 | } |
| 37 | |
| 38 | void TextButton::activate() { |
| 39 | MenuItemSprite::activate(); |
| 40 | this->stopAllActions(); |
| 41 | this->setScale(1.0f); |
| 42 | this->m_fCallback(this); |
| 43 | } |
| 44 | |
| 45 | bool TextButton::init(std::string_view text, std::string_view font, float width, float height, std::string_view bgTexture, std::function<void(TextButton*)> callback) { |
| 46 | if (!MenuItemSprite::initWithNormalSprite(nullptr, nullptr, nullptr, nullptr)) return false; |