AIGameAIGame
首页
API文档
UI框架
API实例
UI实例
下载软件
首页
API文档
UI框架
API实例
UI实例
下载软件
  • API文档

    • $global - 全局函数
    • $act - 手势动作
      • 01.手势动作 - $act
      • 02.节点选择器 - UiSelector
    • $ag - 图色框架
    • $app - 应用操作
    • $arc - 悬浮菜单按钮
      • 01.悬浮菜单 - $arc
      • 02.悬浮容器 - MenuBody
      • 03.菜单按钮 - MenuItem
    • $bus - 消息总线
    • $color - 颜色操作
    • $crypt - 加密算法
    • $device - 设备信息
    • $dex - dex,jar,so文件加载
    • $draw - 全局绘制
    • $engine - 脚本引擎
      • 01.任务信息 - JsTaskInfo
      • 02.脚本对象 - $task
    • $fc - 文件选择器
    • $file - 文件操作
    • $floaty - 悬浮窗
    • $img - 图片操作
    • $log - 日志框架
    • $ocr - 文字识别
    • $res - 资源管理器
      • 01.资源管理器 - $res
      • 02.资源操作 - ResManager
    • $root - ROOT与Shell命令
    • $screen - 屏幕操作
    • $storage - 应用内存储
    • $str - 字符串工具类
    • $sys - 系统操作
    • $thread - 并发编程
    • $tip - 对话框
    • $tts - 文字阅读

$draw 返回

全屏绘制

getPermit()

版本:1.0.0 获取悬浮窗权限

  • 返回 : {boolean} 是否有权限
$draw.getPermit();

rect(rect)

版本:1.0.0 绘制一个方框

  • 参数 : rect {Rect} opencv的Rect对象
//绘制矩形
 $draw.rect(rect);

rect(node)

版本:1.0.0 绘制一个方框

  • 参数 : node {AccessibilityNodeInfo} 节点信息
//绘制矩形
 $draw.rect(node);

rect(x,y,w,h)

版本:1.0.0 绘制一个方框

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : w {int} 宽度
  • 参数 : h {int} 高度
//绘制矩形
 $draw.rect(200,200,200,100);

rect(x,y,w,h,color)

版本:1.1.1 绘制一个方框

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : w {int} 宽度
  • 参数 : h {int} 高度
  • 参数 : color {string} 颜色
//绘制矩形
 $draw.rect(200,200,200,100,"#FF0000");

rect(x,y,w,h,ext)

版本:1.0.0 绘制方框

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : w {int} 宽度
  • 参数 : h {int} 高度
  • 参数 : ext {int} 向四周拓展
//绘制一个向外拓展50像素的矩阵
 $draw.rect(200,200,200,100,50);

rect(x,y,w,h,ext,color)

版本:1.1.0 绘制方框

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : w {int} 宽度
  • 参数 : h {int} 高度
  • 参数 : ext {int} 向四周拓展
  • 参数 : color {string} 颜色
//绘制一个向外拓展50像素的矩阵
 $draw.rect(200,200,200,100,50,"#FF0000");

rect(x,y,w,h,ext,color)

版本:1.1.1 绘制方框

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : w {int} 宽度
  • 参数 : h {int} 高度
  • 参数 : ext {int} 向四周拓展
  • 参数 : color {int} 颜色
//绘制一个向外拓展50像素的矩阵
 $draw.rect(200,200,200,100,50,$color.RED);

cross(point)

版本:1.0.0 绘制一个十字准心

  • 参数 : point {point} 位置
//绘制准心
 $draw.cross(point);

cross(index)

版本:1.0.0 绘制一个十字准心

  • 参数 : index {int[]} 位置
//绘制准心
 $draw.cross([400,500]);

cross(node)

版本:1.0.0 绘制一个十字准心

  • 参数 : node {AccessibilityNodeInfo} 节点信息
//绘制准心
 $draw.cross(node);

cross(x,y)

版本:1.0.0 绘制一个十字准心

  • 参数 : x {int} 中心x
  • 参数 : y {int} 中心y
//绘制准心
 $draw.cross(400,500);

cross(x,y,color)

版本:1.1.0 绘制一个十字准心

  • 参数 : x {int} 中心x
  • 参数 : y {int} 中心y
  • 参数 : color {string} 颜色
//绘制准心
 $draw.cross(400,500,"#FF0000");

cross(x,y,color)

版本:1.1.1 绘制一个十字准心

  • 参数 : x {int} 中心x
  • 参数 : y {int} 中心y
  • 参数 : color {int} 颜色值
//绘制准心
 $draw.cross(400,500,$color.RED);

dot(index)

版本:1.0.0 绘制一个点

  • 参数 : index {int[]} 点
$draw.dot([400,500]);

dot(point)

版本:1.0.0 绘制一个点

  • 参数 : point {point} 点
$draw.dot(point);

dot(x,y)

版本:1.0.0 绘制一个点

  • 参数 : x {int} 点x
  • 参数 : y {int} 点y
//绘制一个点
 $draw.dot(400,500);

dot(x,y,color)

版本:1.0.0 绘制一个点

  • 参数 : x {int} 点x
  • 参数 : y {int} 点y
  • 参数 : color {string} 颜色
//绘制一个点
 $draw.dot(400,500);

dot(x,y,color)

版本:1.1.1 绘制一个点

  • 参数 : x {int} 点x
  • 参数 : y {int} 点y
  • 参数 : color {int} 颜色值
//绘制一个点
 $draw.dot(400,500,$color.RED);

text(text,x,y)

版本:1.0.0 绘制文字

  • 参数 : text {String} 文字
  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
//绘制文字
 $draw.text("Hello aigame !",400,300);

text(text,x,y,size)

版本:1.0.0 绘制文字

  • 参数 : text {String} 文字
  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : size {float} 字体大小
//绘制文字(大小为20像素)
 $draw.text("Hello aigame !",400,400,20);

text(text,x,y,size,color)

版本:1.1.1 绘制文字

  • 参数 : text {String} 文字
  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : size {int} 字体大小
  • 参数 : color {string} 颜色
//绘制文字(大小为20像素)
 $draw.text("Hello aigame !",400,400,20,"#FF0000");

text(text,x,y,size,color)

版本:1.1.1 绘制文字

  • 参数 : text {String} 文字
  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : size {int} 字体大小
  • 参数 : color {int} 颜色值
//绘制文字(大小为20像素)
 $draw.text("Hello aigame !",400,400,20,$color.RED);

circle(x,y)

版本:1.1.1 绘制一个圆形
半径默认为50像素

  • 参数 : x {int} 圆心x
  • 参数 : y {int} 圆心y
//绘制半径为50像素的圆形
 $draw.circle(350,400);

circle(x,y,r)

版本:1.0.0 绘制一个圆形

  • 参数 : x {int} 圆心x
  • 参数 : y {int} 圆心y
  • 参数 : r {int} 圆形半径
//绘制半径为100像素的圆形
 $draw.circle(350,400,100);

circle(x,y,r,ext)

版本:1.0.0 绘制一个圆形

  • 参数 : x {int} 圆心x
  • 参数 : y {int} 圆心y
  • 参数 : r {int} 圆形半径
  • 参数 : ext {int} 圆形向四周拓展
//向外拓展50像素
 $draw.circle(350,400,100,50);

circle(x,y,r,ext,color)

版本:1.0.0 绘制一个圆形

  • 参数 : x {int} 圆心x
  • 参数 : y {int} 圆心y
  • 参数 : r {int} 圆形半径
  • 参数 : ext {int} 圆形向四周拓展
  • 参数 : color {string} 颜色
//向外拓展50像素
 $draw.circle(350,400,100,50,"#FF0000");

circle(x,y,r,ext,color)

版本:1.1.1 绘制一个圆形

  • 参数 : x {int} 圆心x
  • 参数 : y {int} 圆心y
  • 参数 : r {int} 圆形半径
  • 参数 : ext {int} 圆形向四周拓展
  • 参数 : color {int} 颜色值
//向外拓展50像素
 $draw.circle(350,400,100,50,$color.RED);

img(img,x,y,w,h)

版本:1.1.0 绘制图片

  • 参数 : img {Image} 图片对象
  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : w {int} 宽度(绘制后的图片宽度)
  • 参数 : h {int} 高度(绘制后的图片宽度)

line(x,y,toX,toY)

版本:1.0.0 绘制一条线

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : toX {int} 目标x
  • 参数 : toY {int} 目标y
//绘制一条线
 $draw.line(300,0,100,1000);

line(x,y,toX,toY,color)

版本:1.1.1 绘制一条线

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : toX {int} 目标x
  • 参数 : toY {int} 目标y
  • 参数 : color {string} 颜色
//绘制一条线
 $draw.line(300,0,100,1000,"#FF0000");

line(x,y,toX,toY,color)

版本:1.1.1 绘制一条线

  • 参数 : x {int} 起点x
  • 参数 : y {int} 起点y
  • 参数 : toX {int} 目标x
  • 参数 : toY {int} 目标y
  • 参数 : color {int} 颜色值
//绘制一条线
 $draw.line(300,0,100,1000,$color.RED);

path(data)

版本:1.0.0 绘制路径,传入的就是x和y的数组

  • 参数 : data {int[][]} 二维数组,第二维数组是坐标
//国际通用手势
 $draw.path([
     [100, 800],
     [120, 750],
     [150, 720],
     [180, 750],
     [200, 800],
     [200, 800],
     [220, 700],
     [250, 680],
     [280, 700],
     [300, 800],
     [300, 800],
     [320, 250],
     [350, 200],
     [380, 250],
     [400, 800],
     [400, 800],
     [420, 740],
     [450, 730],
     [480, 740],
     [500, 800],
     [500, 800],
     [520, 770],
     [550, 760],
     [580, 770],
     [600, 800]
 ]);

path(data,color)

版本:1.1.1 绘制路径,传入的就是x和y的数组

  • 参数 : data {int[][]} 二维数组,第二维数组是坐标
  • 参数 : color {string} 颜色
//国际通用手势
 $draw.path([
     [100, 800],
     [120, 750],
     [150, 720],
     [180, 750],
     [200, 800],
     [200, 800],
     [220, 700],
     [250, 680],
     [280, 700],
     [300, 800],
     [300, 800],
     [320, 250],
     [350, 200],
     [380, 250],
     [400, 800],
     [400, 800],
     [420, 740],
     [450, 730],
     [480, 740],
     [500, 800],
     [500, 800],
     [520, 770],
     [550, 760],
     [580, 770],
     [600, 800]
 ],"#FF0000");

path(data,color)

版本:1.1.1 绘制路径,传入的就是x和y的数组

  • 参数 : data {int[][]} 二维数组,第二维数组是坐标
  • 参数 : color {int} 颜色值
//国际通用手势
 $draw.path([
     [100, 800],
     [120, 750],
     [150, 720],
     [180, 750],
     [200, 800],
     [200, 800],
     [220, 700],
     [250, 680],
     [280, 700],
     [300, 800],
     [300, 800],
     [320, 250],
     [350, 200],
     [380, 250],
     [400, 800],
     [400, 800],
     [420, 740],
     [450, 730],
     [480, 740],
     [500, 800],
     [500, 800],
     [520, 770],
     [550, 760],
     [580, 770],
     [600, 800]
 ],$color.RED);

i(text,x,y,size)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.i("信息",400,300,40);

i(text,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.i("信息",400,300);

i(text)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.i("信息");

d(text,x,y,size)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.i("调试",400,300,40);

d(text,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.d("调试",400,300);

d(text)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.d("调试");

w(text,x,y,size)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.w("警告",400,300,40);

w(text,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.w("警告",400,300);

w(text)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.w("警告");

e(text,x,y,size)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.e("错误",400,300,40);

e(text,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.e("错误",400,300);

e(text)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.e("错误");

v(text,x,y,size)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.v("信息",400,300,40);

v(text,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.v("信息",400,300);

v(text)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.v("信息");

log(text,color,x,y,size)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
  • 参数 : color {String} 颜色
  • 参数 : x {int} 位置x
  • 参数 : y {int} 位置y
  • 参数 : size {float} 字体大小
$draw.log("信息","#57965C",400,300,40);

log(text,color,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
  • 参数 : color {String} 颜色
  • 参数 : x {int} 位置x
  • 参数 : y {int} 位置y
$draw.log("信息","#57965C",400,300);

log(text,color)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
  • 参数 : color {String} 颜色
$draw.log("信息","#57965C");

log(text)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
$draw.log("信息");

log(text,x,y)

版本:1.0.0 绘制日志文字

  • 参数 : text {String} 文字
  • 参数 : x {int} 位置x
  • 参数 : y {int} 位置y
$draw.log("信息",400,300);

closeAll()

版本:1.0.0 关闭绘制日志的悬浮窗

//关闭所有绘制图案
 $draw.closeAll();

closeAll(delay)

版本:1.0.0 关闭绘制日志的悬浮窗

$draw.closeAll(1000);

closeLog(delay)

版本:1.0.0 关闭绘制日志的悬浮窗

$draw.closeLog(1000);

closeLog()

版本:1.0.0 关闭绘制日志的悬浮窗

$draw.closeLog();
最近更新:: 2025/5/14 08:43
Contributors: 孑小白
Prev
$dex - dex,jar,so文件加载
Next
$engine - 脚本引擎