UNPKG

laya-coreui-es

Version:

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

28 lines (27 loc) 847 B
import { Pool } from "../../utils/Pool"; export class Draw9GridTexture { static create(texture, x, y, width, height, sizeGrid) { var cmd = 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.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() { } } Draw9GridTexture.ID = "Draw9GridTexture";