在 creator2.0中是使用如下方式为在native(iOS)端渲染2d Sprite,请教下升级到creator3.0后如何处理类似逻辑
this.texture = new cc.Texture2D()
this.texture.initWithData(null, cc.Texture2D.PixelFormat.RGBA8888, this.node.width, this.node.height);
this.sprite.spriteFrame = new cc.SpriteFrame(this.texture);
update(dt) {
jsb.decodeVideoFrame.bindTextureId(this.texture.getImpl().getHandle());
}
Navtive(ios)
jsb_decodeVideoFrame_bindTextureId(unsigned int textureId) {
glBindTexture(GL_TEXTURE_2D, textureId);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, fheight, 0,
GL_RGBA,GL_UNSIGNED_BYTE, data);
glBindTexture(GL_TEXTURE_2D, 0);
}
creator3.0 中Texture2D的很多方法都不同了 :)