We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tile.js 第2833行 if (this.images.length > 1) { _spritesheet = spritesheets[tile.gid - this.firstgid]; var rect = new egret.Rectangle(0 * (this.tilewidth + this._spacing) + this._spacing, 0 * (this.tileheight + this._margin) + this._margin, this.tilewidth, this.tileheight); } else { _spritesheet = spritesheets[0]; var rect = new egret.Rectangle((id % this.horizontalTileCount) * (this.tilewidth + this._spacing) + this._spacing, (Math.floor(id / this.horizontalTileCount)) * (this.tileheight + this._margin) + this._margin, this.tilewidth, this.tileheight); } 可以看到你算rect的x位置时,代码用的是编号x间距+间距,y位置时则是编号x边距+边距 但实际上无论x还是y,都应该是编号x间距+边距(间距是两个图块直接的距离,边距是所有图块和纹理集边缘的距离),否则除非边距和间距相等,否则排版一定出现问题(结果是拼接出的地图到处都是黑线,无法互相贴合) 应该改成 if (this.images.length > 1) { _spritesheet = spritesheets[tile.gid - this.firstgid]; var rect = new egret.Rectangle(0 * (this.tilewidth + this._spacing) + this._margin, 0 * (this.tileheight + this._spacing) + this._margin, this.tilewidth, this.tileheight); } else { _spritesheet = spritesheets[0]; var rect = new egret.Rectangle((id % this.horizontalTileCount) * (this.tilewidth + this._spacing) + this._margin, (Math.floor(id / this.horizontalTileCount)) * (this.tileheight + this._spacing) + this._margin, this.tilewidth, this.tileheight); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tile.js 第2833行
if (this.images.length > 1) {
_spritesheet = spritesheets[tile.gid - this.firstgid];
var rect = new egret.Rectangle(0 * (this.tilewidth + this._spacing) + this._spacing, 0 * (this.tileheight + this._margin) + this._margin, this.tilewidth, this.tileheight);
}
else {
_spritesheet = spritesheets[0];
var rect = new egret.Rectangle((id % this.horizontalTileCount) * (this.tilewidth + this._spacing) + this._spacing, (Math.floor(id / this.horizontalTileCount)) * (this.tileheight + this._margin) + this._margin, this.tilewidth, this.tileheight);
}
可以看到你算rect的x位置时,代码用的是编号x间距+间距,y位置时则是编号x边距+边距
但实际上无论x还是y,都应该是编号x间距+边距(间距是两个图块直接的距离,边距是所有图块和纹理集边缘的距离),否则除非边距和间距相等,否则排版一定出现问题(结果是拼接出的地图到处都是黑线,无法互相贴合)
应该改成
if (this.images.length > 1) {
_spritesheet = spritesheets[tile.gid - this.firstgid];
var rect = new egret.Rectangle(0 * (this.tilewidth + this._spacing) + this._margin, 0 * (this.tileheight + this._spacing) + this._margin, this.tilewidth, this.tileheight);
}
else {
_spritesheet = spritesheets[0];
var rect = new egret.Rectangle((id % this.horizontalTileCount) * (this.tilewidth + this._spacing) + this._margin, (Math.floor(id / this.horizontalTileCount)) * (this.tileheight + this._spacing) + this._margin, this.tilewidth, this.tileheight);
}
The text was updated successfully, but these errors were encountered: