Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88957

新手求助,请问怎么切换精灵贴图

$
0
0

@329973692 写道:

在API参考中搜贴图,找不到切换相关的操作。
照着这篇https://forum.cocos.org/t/sprite/45951
按照里面的格式
properties: {
player: {
default: null,
type: cc.Node
},
texture1: {
default: null,
type: cc.SpriteFrame
},
},
onLoad: function () {
this.player.SpriteFrame.setTexture(texture1);
},
结果运行即不报错也没有成功切换贴图。

帖子: 2

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>