laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
24 lines (23 loc) • 674 B
JavaScript
import { Pool } from "../../utils/Pool";
export class DrawTexturesCmd {
static create(texture, pos) {
var cmd = Pool.getItemByClass("DrawTexturesCmd", DrawTexturesCmd);
cmd.texture = texture;
texture._addReference();
cmd.pos = pos;
return cmd;
}
recover() {
this.texture._removeReference();
this.texture = null;
this.pos = null;
Pool.recover("DrawTexturesCmd", this);
}
run(context, gx, gy) {
context.drawTextures(this.texture, this.pos, gx, gy);
}
get cmdID() {
return DrawTexturesCmd.ID;
}
}
DrawTexturesCmd.ID = "DrawTextures";