Skip to content

SpriteBatchNode doesn't support setFlipped. #13228

@fusijie

Description

@fusijie

version: v3.8
issue: The sprite under the SpriteBatchNode doesn't support setFlipped.Because updateTransform method reset the vertices conflict with #13138.
reproduce:

    SpriteFrameCache::getInstance()->addSpriteFramesWithFile("blocks9ss.plist");

    auto spritebatchnode = SpriteBatchNode::create("blocks9ss.png");
    this->addChild(spritebatchnode);

    // add "HelloWorld" splash screen"
    auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png");
    // position the sprite on the center of the screen
    sprite->setPosition(Vec2(visibleSize / 2) + origin);

    // add the sprite as a child to this layer
    spritebatchnode->addChild(sprite);

    sprite->setFlippedX(true);
    sprite->setFlippedY(true);

    this->scheduleOnce([=](float){
        sprite->setFlippedX(false);
        sprite->setFlippedY(false);
    }, 2.0, "lbd");

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions