[0]在安卓手机上drawToTexture不能正确返回纹理对象,是HTMLCanvas

浏览器上 是能返回正确值,在layaNative模式出包。手机上调用此方法返回的对象类型不对
  
private _agentTexture: any;
private _agent:Laya.Sprite; 
 
public startDrag(dragCom: Laya.Sprite, touchID: number, sourceData?: any): void {let bounds = dragCom.getSelfBounds();
this._agentTexture = Laya.Sprite.drawToTexture(dragCom,Laya.SpriteConst.TEXTURE,bounds.width, bounds.height, -bounds.x + view.x, -bounds.y + view.y);
this._agent.graphics.drawTexture(this._agentTexture, (this._agent.width - bounds.width) * 0.5, (this._agent.height - bounds.height) * 0.5);
 
}
 
微信截图_20210911153741.png
已邀请:

Laya_Fred

赞同来自:

感谢反馈,我们查看一下,有最新消息会回复您。

zon

赞同来自:

而且,saveAsPng后调用微信分享,分享出来的图片是镜面的~

Laya_XS

赞同来自:

为了应急,你可以用drawToCanvas接口,目前这个接口是可以的,你可以看下drawToCanvas接口的使用说明。等drawToTexture修复了我们会在更新日志里加上说明。

要回复问题请先

商务合作
商务合作