MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / MenuItemSpriteExtra

Method MenuItemSpriteExtra

Source/MenuItemSpriteExtra.cpp:27–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25static constexpr float BUTTON_MULTIPLIER = 1.26f;
26
27MenuItemSpriteExtra::MenuItemSpriteExtra(std::string_view spriteStr, Node* sprNode, std::function<void(Node*)> callback) {
28 if (spriteStr.empty() && !sprNode) {
29 m_pSprite = Sprite::createWithSpriteFrameName("GJ_newBtn_001.png");
30 }
31 else {
32 m_pSprite = spriteStr.empty() ? sprNode : Sprite::createWithSpriteFrameName(spriteStr);
33 }
34 //m_pSprite->setStretchEnabled(false);
35 float nodescale = m_pSprite ? m_pSprite->getScale() : 1.0f;
36 m_fScaleMult = BUTTON_MULTIPLIER;
37 m_fSelectedScale = nodescale * m_fScaleMult;
38 m_fUnselectedScale = nodescale;
39 m_fAnimDuration = 0.3f;
40 m_fCallback = callback;
41}
42
43void MenuItemSpriteExtra::setDestination(ax::Vec2 dest) {
44 _altAnim = true;

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected