我想把下面的代码转为laya TS语法
backgroundColor="#ffffff" borderColor="#000000" alpha="1"
horizontalScrollPolicy="off" verticalScrollPolicy="off"
mouseEnabled="true"
mouseOver="/*trace(this);*/currentCabinet=this;"
>
import mx.core.UIComponent;
public var cabId:int = 0;
public var U:int = 42;
public var frameFace:int = 1;
public function add(child:UIComponent):void
{
this.cab.addChild(child);
}
public function getDevices():Array
{
return this.cab.getChildren();
}
public function getHeight():Number
{
return this.cab.height;
}
//获取机柜每U的高度
public function getHeightOfOneU():Number
{
if(this.U<=0) return 0;
return this.cab.height/this.U;
}
private function setCurrentCabinet(ev:MouseEvent):void
{
}
//记录当前机柜
public static var currentCabinet:Cabinet;
public function isInCab():Boolean
{
if(this.cab.mouseX<0 || this.cab.mouseX>this.cab.width) return false;
if(this.cab.mouseY<0 || this.cab.mouseY>this.cab.height) return false;
return true;
}
//对外提供全局坐标到cab容器的本地坐标转换
public function global2Content(p:Point):Point
{
return this.cab.globalToContent(p);
}
]]>
转换过程 mx.containers.Canvas报错