[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);
}
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);
}
要回复问题请先登录
3 个回复
Laya_Fred
赞同来自:
zon
赞同来自:
Laya_XS
赞同来自: