How to add a sprite to layer from a other thread? (cocos2dx-V3.x)


#1

I have 2 sprites, i add the first sprite to layer, when i click this sprite i want to add second sprite from a other thread.
please help me!


#2

You can use Schedule::performFunctionInCocosThread().


#3

@zhangxm thank you, :slight_smile:


#4

@zhangxm, help me one more time, please!
i use ScrollView and add some Menu (this Menu contain some MenuItemSprite), when i touch into MenuItemSprite to scroll screen, it can not scroll, but i touch out of MenuItemSprite, it can. So, i want to touch into MenuItemSprite to scroll, how can i do that?