[LayaAir 2.0]laya.sprite精灵无缝拼接地图,会出现黑线跟白线,使用laya的2.0.1beta版本
使用showall的适配就会出现这些黑线(其他方式不会),我的游戏需要showall方式的适配的!!!!
请问一下 应该怎么解决这个问题,位置定位是没错,而且都是整数的移动地图的。
export default class MapSprite extends Laya.Image{
isShow:boolean = false;
name:string = "";
constructor() {
super();
}
loadImageAndPos(name:string,posX:number,posY:number):void {
this.name = name;
this.anchorX = 0;
this.anchorY = 0;
this.x = posX; //这里是256*整数倍的叠加 每张图片都是256*256大小的地图块
this.y = posY; //这里是256*整数倍的叠加 每张图片都是256*256大小的地图块
this.isShow = true;
Laya.loader.load(name,Laya.Handler.create(this,this.drawImg));
}
drawImg():void {
var texture:Laya.Texture = Laya.loader.getRes(this.name);
this.texture = texture;
}
clearImage(): void{
if (this.name != "") {
this.isShow = false;
Laya.Loader.clearTextureRes(this.name);
Laya.Loader.clearRes(this.name);
this.name = "";
}
}
}
请问一下 应该怎么解决这个问题,位置定位是没错,而且都是整数的移动地图的。
export default class MapSprite extends Laya.Image{
isShow:boolean = false;
name:string = "";
constructor() {
super();
}
loadImageAndPos(name:string,posX:number,posY:number):void {
this.name = name;
this.anchorX = 0;
this.anchorY = 0;
this.x = posX; //这里是256*整数倍的叠加 每张图片都是256*256大小的地图块
this.y = posY; //这里是256*整数倍的叠加 每张图片都是256*256大小的地图块
this.isShow = true;
Laya.loader.load(name,Laya.Handler.create(this,this.drawImg));
}
drawImg():void {
var texture:Laya.Texture = Laya.loader.getRes(this.name);
this.texture = texture;
}
clearImage(): void{
if (this.name != "") {
this.isShow = false;
Laya.Loader.clearTextureRes(this.name);
Laya.Loader.clearRes(this.name);
this.name = "";
}
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
4 个回复
尾号
赞同来自:
Aar0n
赞同来自:
尾号
赞同来自:
var texture:Laya.Texture = Laya.loader.getRes(this.name);
this.graphics.fillTexture(texture,0,0,256,256,"repeat");
// this.texture = texture;
} 这样设置 没什么效果~~ 设置那个Canvas也没有效果
178*****216
赞同来自: