你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
Sy
赞同来自:
const matrices = Array(4).fill('').map(_ => new Laya.Matrix()) matrices.forEach((matrix, i) => matrix.rotate(Math.PI / 2 * i)) tileIndices.forEach((idxOnSource, idxOnTilemap) => { if (!idxOnSource) return const position = tilemap.getTilePositionByIndex(idxOnTilemap) const tileTexture = getTexture(idxOnSource) const matrix = matrices[(tileRotates && tileRotates[idxOnTilemap]) || 0] this.graphics.drawTexture(tileTexture, position.x, position.y, tileSize, tileSize, matrix) })
March
要回复问题请先登录
2 个回复
Sy
赞同来自:
March
赞同来自:
// x
// matrix.scale(-1,1)
// matrix.tx = t.sourceWidth
// y
// matrix.scale(1, -1)
// matrix.ty = t.sourceHeight
// x + y
matrix.scale(-1, -1)
matrix.tx = t.sourceWidth
matrix.ty = t.sourceHeight
p.graphics.drawTexture(t, 0,0,null,null,matrix);