[按键精灵] 纯文本查看 复制代码
Function 创建悬浮窗()
Dim 表={_
"窗口":{"属性":"窗口","控件名字":"测试窗口","范围":{0,0,590,60},"背景色":"000000","透明度":100},_
"文字框1":{"属性":"文字框","控件名字":"测试内容1","显示内容":"显示一","范围":{0,0,329,60},"字体颜色":"1FC5F4","字体大小":10},_
"文字框2":{"属性":"文字框","控件名字":"测试内容2","显示内容":"显示二","范围":{100,0,329,60},"字体颜色":"E9731A","字体大小":10},_
"文字框3":{"属性":"文字框","控件名字":"测试内容3","显示内容":"显示三","范围":{200,0,329,60},"字体颜色":"D6C54E","字体大小":10},_
"文字框4":{"属性":"文字框","控件名字":"测试内容4","显示内容":"显示四","范围":{0,20,329,60},"字体颜色":"FFFFFF","字体大小":10},_
"文字框5":{"属性":"文字框","控件名字":"测试内容5","显示内容":"显示五","范围":{100,20,329,60},"字体颜色":"00FF00","字体大小":10},_
"文字框6":{"属性":"文字框","控件名字":"测试内容6","显示内容":"显示六","范围":{200,20,329,60},"字体颜色":"FFFF00","字体大小":10},_
"按钮1":{"属性":"按钮","控件名字":"最小化控件","显示内容":"-","范围":{ 500, 0, 40, 40},"字体颜色":"000000","字体大小":10},_
"按钮2":{"属性":"按钮","控件名字":"关闭控件","显示内容":"X","范围":{ 550, 0, 40, 40},"字体颜色":"000000","字体大小":10},_
"按钮3":{"属性":"按钮","控件名字":"暂停脚本","显示内容":"II","范围":{ 450, 0, 40, 40},"字体颜色":"000000","字体大小":10}}
FW.NewFWindow 表["窗口"]["控件名字"], 表["窗口"]["范围"][1], 表["窗口"]["范围"][2], 表["窗口"]["范围"][3], 表["窗口"]["范围"][4]
If 表["窗口"]["背景色"] <> null or 表["窗口"]["背景色"] <> "" Then
FW.SetBackColor(表["窗口"]["控件名字"],表["窗口"]["背景色"])
End If
If 表["窗口"]["透明度"] <> null or 表["窗口"]["透明度"] <> "" Then
FW.Opacity (表["窗口"]["控件名字"],表["窗口"]["透明度"])
End If
For Each v , k In 表
TracePrint v, k["属性"]
Select Case k["属性"]
Case "文字框"
TracePrint k["显示内容"]
FW.AddTextView 表["窗口"]["控件名字"], k["控件名字"], k["显示内容"], k["范围"][1], k["范围"][2], k["范围"][3], k["范围"][4]
If k["字体颜色"] <> null or k["字体颜色"] <> "" Then
FW.SetTextColor k["控件名字"], k["字体颜色"]
End If
If k["字体大小"] <> null or k["字体大小"] <> "" Then
FW.SetTextSize k["控件名字"], k["字体大小"]
End If
Case "按钮"
FW.AddButton 表["窗口"]["控件名字"], k["控件名字"], k["显示内容"], k["范围"][1], k["范围"][2], k["范围"][3], k["范围"][4]
If k["字体大小"] <> null or k["字体大小"] <> "" Then
FW.SetTextSize k["控件名字"], k["字体大小"]
End If
End Select
Next
FW.SetOnClick("关闭控件", 关闭浮窗)
FW.SetOnClick("最小化控件", 最小化浮窗)
// FW.SetOnClick("暂停脚本", 暂停脚本)
FW.Show (表["窗口"]["控件名字"])
End Function
Function 关闭浮窗()
fw.Close("测试窗口")
End Function
Function 最小化浮窗()
fw.Close ("测试窗口")
FW.NewFWindow "最小化浮窗", 0, 0, 100, 50
FW.IsTouchMove("最小化浮窗", true)
FW.Opacity "最小化浮窗", 50
FW.AddButton("最小化浮窗", "还原悬浮窗","三",0, 0, 50, 50)
FW.SetOnClick("还原悬浮窗", 打开创建悬浮窗)
FW.Show("最小化浮窗")
End Function
Function 打开创建悬浮窗()
fw.Close("最小化浮窗")
创建悬浮窗
End Function
Dim a=0,b=0,c=1
打开创建悬浮窗
Do
a = a + 1
b = b + 2
c=c*2
FW.SetText "测试内容1", a//修改悬浮窗显示内容
FW.SetText "测试内容3", b//修改悬浮窗显示内容
FW.SetText "测试内容5", c//修改悬浮窗显示内容
Delay 1000
Loop