How to Twist the HUD layer

HI ,
I am new to cocos2dx , my requirement is how to twist the HUD layer means flip horizontally .is it possible in cocos2dx?
if any body have know about this issue please guid me .thanks in advance

You can set the scale of the layer to a negative value for example setScaleX(–1.0f);

This would be a good issue to post on github or the redmine issue tracker.

setScaleX(1f) seems like a bad hack we should come up with a better method to do this, like CCSprite.FlipX, but on CCLayer.FlipX.

hi thanks ,

When i am setscalex(–1.0f), the layer goes to out side of the screen. is there any sample code for flipx for cclayers.

Sorry but there is no flipx for cclayer. setscalex worked for me.

You can use CCOrbitCamera. I am using it in one of my game. I am using it in two parts so two commands are there otherwise one command is suffice to make the flip effect. Just play around with it.

CCActionInterval firstHalf = CCOrbitCamera::create;
CCActionInterval
secondHalf = CCOrbitCamera::create(d/2, 1, 0, 270, 90, 0, 0);

node->runAction(CCSequence::create(firstHalf, changeDisplayFrame, secondHalf, NULL));

try it. It should work.

Thanks @paras.I’ve tried your code.But it doesn’t fit to my problem.Actually i want the HUD layer should flip Horizontally.All the objects in the HUD should look reverse,as shown in the above attachment.

This problem is solved with empty sprite image, I am adding all objects , as a children’s of that empty sprite, that sprite is child of cclayer .so i am simply using sprite->setscaleX(–1.0f);
it works very well.thanks for all who guid me.