1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
screentolayer(layer, screenx,screeny, layerx,layery) layertoscreen(layer, layerx,layery, screenx,screeny) 屏幕坐标与layer坐标之间互换. 参数: •layer ◦layer的name. •screenx / screenx ◦左上角对齐的屏幕x、y坐标. •layerx / layery ◦左上角对齐的layer中的x、y坐标. 注意: •屏幕坐标右左上角x=0、y=0开始,到屏幕右下角stagewidth和stagehight. •当scalechildren设置为enabled时,layer坐标支持缩放变化. •已旋转角度的layer支持转换! •所有参数必须为变量,不能为值! •变量不存在时,则自动创建. 样例: screentolayer(bar, mouse.stagex,mouse.stagey, lx,ly); div(fill, lx, layer[bar].pixelwidth); mul(fill, 100); clamp(fill, 0, 100); txtadd(layer[barfill].width, get(fill), '%'); |