Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc.Sprite('')希望添加一下功能吧 #1347

Closed
GameKeys opened this issue Dec 9, 2016 · 2 comments
Closed

cc.Sprite('')希望添加一下功能吧 #1347

GameKeys opened this issue Dec 9, 2016 · 2 comments

Comments

@GameKeys
Copy link

GameKeys commented Dec 9, 2016

Sprite(SpriteFrame|String newSpriteFrame) {
var node = new cc.Node("Sprite");
var sprite = node.addComponent(cc.Sprite);
sprite.spriteFrame = newSpriteFrame;
return sprite
}
cc.loader.loadxxx
var abc=cc.Sprite('abc');

希望添加这样的功能吧!不止Sprite。。。

@jareguo
Copy link
Contributor

jareguo commented Dec 9, 2016

可以考虑提供一些类似 cc.Sprite.createNode('abc') 的 API,不过这种函数用户很容易自己封装一下吧?

@ZuoEr
Copy link

ZuoEr commented Sep 17, 2019

感觉没必要,之前就是这种API太多,臃肿

@jareguo jareguo closed this as completed Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants