cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.24k stars 7.06k forks source link

[Cocos2d-x JS] Change texture of specific mesh in Sprite3D #15007

Open alankevin2 opened 8 years ago

alankevin2 commented 8 years ago

Hi cocos2d developer

Recently, I encountered a problem which was about changing texture of a Sprite3D. setTexture method of Sprite3D you have provided, changes texture of every mesh in Sprite3D, and this is not what we expected.

I mean, there should be a way to change the texture of specific mesh. While I trace deep into native code, I found out that CCMesh declared setTexture method which was using polymorphism, and thus made you skip binding them to the javascript.

I strongly suggest that this requirement should be added officially. ex : mySprite3D.getMeshByName("card").setTextureByFile("res/card.png");

Thanks in advance

loohoo commented 7 years ago

just give up using cocos2dx