MCPcopy Create free account
hub / github.com/axmolengine/axmol / setNormalImage

Method setNormalImage

core/2d/MenuItem.cpp:412–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410//
411
412void MenuItemSprite::setNormalImage(Node* image)
413{
414 if (image != _normalImage)
415 {
416 if (image)
417 {
418 addChild(image);
419 image->setAnchorPoint(Vec2(0, 0));
420 }
421
422 if (_normalImage)
423 {
424 removeChild(_normalImage, true);
425 }
426
427 _normalImage = image;
428 if (_normalImage != nullptr)
429 {
430 this->setContentSize(_normalImage->getContentSize());
431 }
432 this->updateImagesVisibility();
433 }
434}
435
436void MenuItemSprite::setSelectedImage(Node* image)
437{

Callers

nothing calls this directly

Calls 5

Vec2Class · 0.70
setAnchorPointMethod · 0.45
setContentSizeMethod · 0.45
getContentSizeMethod · 0.45

Tested by

no test coverage detected