Mask screen adaptability issue

Mask screen adaptability issue
0

Hello, I set up a sprite and it’s mask in the ensuing manner:

	Sprite = Sprite::create("sprite.png");
	Sprite ->setPosition(visibleSize.width / -30 + origin.x, visibleSize.height / -1.12 + origin.y);
	Sprite ->setScale(visibleSize.width / 1530, visibleSize.height / 1200);
	//
	clipper= ClippingNode::create();
	
	
	mask= Sprite::create(cover);
	mask->setPosition(visibleSize.width / -9 + origin.x, visibleSize.height / -1.09 + origin.y);
	mask->setScale(visibleSize.width / 2400, visibleSize.height / 1400);
	mask->setRotation(90);

	clipper->setStencil(mask);
	clipper->setInverted(true);
        clipper->addChild(Sprite);
//...
	Node->addChild(clipper);

The sprite’s position and scale is fine, I have observed it as an .exe and on a mobile device. Sprite is adaptable.

On the other hand, the mask, which is sufficient size and position on the .exe, is slightly less sufficient on the mobile device. Sprite is hidden perfectly on .exe, however slightly showing on the mobile device. How can I make the mask adaptable for all phones, I scaled and positioned it in a way most adaptable assets are positioned and scaled.

Solution.

You cannot rotate masks using setRotation. This is a rather inconvenient.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.