laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
32 lines (31 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Draw9GridTexture = void 0;
const Pool_1 = require("../../utils/Pool");
class Draw9GridTexture {
static create(texture, x, y, width, height, sizeGrid) {
var cmd = Pool_1.Pool.getItemByClass("Draw9GridTexture", Draw9GridTexture);
cmd.texture = texture;
texture._addReference();
cmd.x = x;
cmd.y = y;
cmd.width = width;
cmd.height = height;
cmd.sizeGrid = sizeGrid;
return cmd;
}
recover() {
this.texture._removeReference();
Pool_1.Pool.recover("Draw9GridTexture", this);
}
run(context, gx, gy) {
context.drawTextureWithSizeGrid(this.texture, this.x, this.y, this.width, this.height, this.sizeGrid, gx, gy);
}
get cmdID() {
return Draw9GridTexture.ID;
}
constructor() {
}
}
exports.Draw9GridTexture = Draw9GridTexture;
Draw9GridTexture.ID = "Draw9GridTexture";