laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
21 lines (20 loc) • 552 B
JavaScript
import { Pool } from "../../utils/Pool";
export class RotateCmd {
static create(angle, pivotX, pivotY) {
var cmd = Pool.getItemByClass("RotateCmd", RotateCmd);
cmd.angle = angle;
cmd.pivotX = pivotX;
cmd.pivotY = pivotY;
return cmd;
}
recover() {
Pool.recover("RotateCmd", this);
}
run(context, gx, gy) {
context._rotate(this.angle, this.pivotX + gx, this.pivotY + gy);
}
get cmdID() {
return RotateCmd.ID;
}
}
RotateCmd.ID = "Rotate";