//
// ButtonSprite::init from 0x2e3a18 to 0x2e3b6c (340 bytes)
//
// 1 xrefs:
// > ButtonSprite::create @ 0x2e3bba
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool ButtonSprite::init(
ButtonSprite *a1,
const char *a2,
int a3,
int a4,
float a5,
bool a6,
const char *a7,
const char *a8,
float a9)
{
_BOOL4 v13; // r7
cocos2d::CCLabelBMFont *v14; // r0
ButtonSprite_vtbl *v15; // r3
cocos2d::extension::CCScale9Sprite *v16; // r0
cocos2d::extension::CCScale9Sprite_vtbl *v17; // r3
cocos2d::extension::CCScale9Sprite *v18; // r6
void (__fastcall *setContentSize)(cocos2d::extension::CCScale9Sprite *__hidden, const cocos2d::CCSize *); // r8
float v21; // r2
float v22; // r3
int v23; // [sp+Ch] [bp-30h]
cocos2d::CCPoint v24; // [sp+1Ch] [bp-20h] BYREF
cocos2d::CCRect v25; // [sp+24h] [bp-18h] BYREF
cocos2d::CCSize v26; // 0:^0.8
cocos2d::CCRect v27; // 0:kr00_16.16
v13 = cocos2d::CCSprite::init(a1);
if ( v13 )
{
a1->m_mode = 1;
a1->m_scale = a5;
a1->m_absolute = a6;
a1->m_width = (float)a3;
a1->m_height = a9;
a1->m_minWidth = (float)a4;
cocos2d::CCPoint::CCPoint(&v25.origin, 0.0, 2.0);
cocos2d::CCPoint::operator=(&a1->m_textOffset, &v25);
sub_776584((int)&v24, (char *)a7);
sub_776584((int)&v25, "bigFont.fnt");
v23 = sub_774DBC(&v24, &v25);
sub_774008(&v25);
sub_774008(&v24);
if ( !v23 )
{
cocos2d::CCPoint::CCPoint(&v24, 0.0, 2.0);
cocos2d::CCPoint::CCPoint(&v25.origin, -1.0, v24.y);
cocos2d::CCPoint::operator=(&a1->m_textOffset, &v25);
}
v14 = cocos2d::CCLabelBMFont::create();
v15 = a1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_label = v14;
v15->addChild_0(a1, v14, 1);
cocos2d::CCRect::CCRect(&v25, 0.0, 0.0, 40.0, 40.0);
v27.origin.x = v21;
v27.origin.y = v22;
v27.size = v26;
v16 = (cocos2d::extension::CCScale9Sprite *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)a8,
(const char *)&v25,
v27);
v17 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v18 = v16;
a1->m_BGSprite = v16;
setContentSize = v17->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v25, 16.0, 16.0);
setContentSize(v18, (const cocos2d::CCSize *)&v25);
a1->addChild_0(a1, a1->m_BGSprite, 0);
ButtonSprite::setString(a1, a2);
}
return v13;
}