小游戏
const img = new engine.Image()
img.src = 'https://......'
img.onload = () => {
const texture = new engine.Texture2D()
texture.initWithImage(img)
const spriteFrame = engine.SpriteFrame.createFromTexture(texture)
engine.game.activeScene2D.root.transform2D
.findChildByName('......')......entity
.getComponent(engine.UISprite).spriteFrame = spriteFrame
}
哎,研究半天小游戏框架,终于能显示出图片了
这个尽快搞吧,不合规的话又通知又处罚的,我的都整完了