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

Method copyTo

core/ui/UIScale9Sprite.cpp:414–436  ·  view source on GitHub ↗

* @brief Returns a copy of the Scale9Sprite */

Source from the content-addressed store, hash-verified

412 * @brief Returns a copy of the Scale9Sprite
413 */
414void Scale9Sprite::copyTo(Scale9Sprite* copy) const
415{
416 copy->initWithSpriteFrame(getSpriteFrame(), getCapInsets());
417
418 copy->setRenderingType(_renderingType);
419 copy->setScale9Enabled(isScale9Enabled());
420 // setStretchEnabled after setScale9Enabled, fix issue: https://github.com/axmolengine/axmol/issues/491
421 copy->setStretchEnabled(isStretchEnabled());
422 copy->_isPatch9 = _isPatch9;
423 copy->_brightState = _brightState;
424
425 // these properties should be part of Sprite::clone() (or Node::clone())
426 // but cloning is not supported on those nodes
427 copy->setContentSize(getContentSize());
428 copy->setPosition(getPosition());
429 copy->setScale(getScaleX(), getScaleY());
430 copy->setRotation(getRotation());
431 copy->setRotationSkewX(getRotationSkewX());
432 copy->setRotationSkewY(getRotationSkewY());
433 copy->setColor(getColor());
434 copy->setOpacity(getOpacity());
435 copy->_originalContentSize = _originalContentSize;
436}
437
438// (0,0) O = capInsets.origin
439// v0----------------------

Callers 3

copySpecialPropertiesMethod · 0.45
copySpecialPropertiesMethod · 0.45
copySpecialPropertiesMethod · 0.45

Calls 15

getSpriteFrameFunction · 0.85
getScaleXFunction · 0.85
getScaleYFunction · 0.85
getOpacityFunction · 0.85
setRenderingTypeMethod · 0.80
setStretchEnabledMethod · 0.80
getPositionFunction · 0.50
getRotationFunction · 0.50
getColorFunction · 0.50
initWithSpriteFrameMethod · 0.45
setScale9EnabledMethod · 0.45
setContentSizeMethod · 0.45

Tested by

no test coverage detected