UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

29 lines (28 loc) 885 B
import { Pool } from "../../utils/Pool"; export class FillTextureCmd { static create(texture, x, y, width, height, type, offset, other) { var cmd = Pool.getItemByClass("FillTextureCmd", FillTextureCmd); cmd.texture = texture; cmd.x = x; cmd.y = y; cmd.width = width; cmd.height = height; cmd.type = type; cmd.offset = offset; cmd.other = other; return cmd; } recover() { this.texture = null; this.offset = null; this.other = null; Pool.recover("FillTextureCmd", this); } run(context, gx, gy) { context.fillTexture(this.texture, this.x + gx, this.y + gy, this.width, this.height, this.type, this.offset, this.other); } get cmdID() { return FillTextureCmd.ID; } } FillTextureCmd.ID = "FillTexture";