can tint effect in the sprite child ?

can tint effect in the sprite child ?
0.0 0


auto tint = Sequence::create(TintTo::create(1, 255, 0, 0),TintTo::create(1, 0, 255, 0),
TintTo::create(1, 0, 0, 255),NULL);

auto ddd = Sprite::create(s_pathSister1);
auto ddd1 = Sprite::create(s_pathSister1);

ddd1->setPosition( Point( 300,0) );


but , the effect is only in ddd, it is not in ddd1.
can it all have effect?


You should invoke Node::setCascadeColorEnabled() to make parent color effects children’s color.



oh it is ok!
thank you very much!

and do you know how to swallowsTouches the ControlButton? i can not find it.
i only see the register listener , but can not find remove listener , where it remove the listener?:slight_smile:


Does Control::removeTargetWithActionForControlEvents meets your need?


@ha397666 can you tell me why you want to swallows ControlButton 's Touches event. just curious:)


oh thank you,
and do you know how to swallowsTouches the ControlButton ? sorry my problem is so much…


I’m make a game , and have some button,the bottom layer have map,so i want the button swallows touches event. but i can not find it.


@ha397666 in my experiences. button is swallowing touches event. So I think you problem is how to pass the touches event but not swallows touches event?




you can use this method.


is set if Swallow Touches events

and begin return the bool result means can still recieve “move” and “end” events or not.

the default always return TRUE,but this event listener can recieve it too.


but this function is CC_DEPRECATED_ATTRIBUTE , it not Recommend。:frowning: