管理员

//欢迎加入游戏群autojs,群聊号码:679039516
//画个表.js

"ui";
ui.statusBarColor("#ff000000");
ui.layout(
<frame id="bg" background="#000000">
<vertical>
<img id="ok"/>
<text id="text" color="#ffffff"/>
</vertical>
</frame>
);
importClass(android.graphics.Paint);
importClass(android.graphics.Canvas);
importClass(android.graphics.Bitmap);
threads.start(function(){
var i=0;
var t1=1000,t2=0;
while(true){
var bitmap =Bitmap.createBitmap(1080,1080,Bitmap.Config.ARGB_8888);
var canvas = new Canvas(bitmap);
canvas.drawARGB(0,0,0,0);
var paint = new Paint();
paint.setARGB(255,55,55,55);
paint.setStyle(Paint.Style.FILL);
canvas.drawCircle(540,540,20, paint);
paint.setARGB(255,255,255,255);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(1);
canvas.drawCircle(540,540,500, paint);
for(var 刻度=0;刻度<360;刻度+=30){
var 度数=(Math.PI/180)*(刻度-90);
paint.setARGB(255,0,255,255);
paint.setStrokeWidth(1);
canvas.drawLine(400*Math.cos(度数)+540,400*Math.sin(度数)+540,480*Math.cos(度数)+540,480*Math.sin(度数)+540,paint);
}
var 时间=new Date();
刻度=时间.getHours()*30+(时间.getMinutes()/60)*30;
度数=(Math.PI/180)*(刻度-90);
var 针尾度数=(Math.PI/180)*(刻度+90);
paint.setARGB(255,255,0,0);
paint.setStrokeWidth(1);
canvas.drawLine(100*Math.cos(针尾度数)+540,100*Math.sin(针尾度数)+540,200*Math.cos(度数)+540,200*Math.sin(度数)+540,paint);
刻度=时间.getMinutes()*6+(时间.getSeconds()/60)*6;
度数=(Math.PI/180)*(刻度-90);
var 针尾度数=(Math.PI/180)*(刻度+90);
paint.setARGB(255,0,255,0);
paint.setStrokeWidth(1);
canvas.drawLine(100*Math.cos(针尾度数)+540,100*Math.sin(针尾度数)+540,250*Math.cos(度数)+540,250*Math.sin(度数)+540,paint);
刻度=时间.getSeconds()*6+(时间.getMilliseconds()/1000)*6;
度数=(Math.PI/180)*(刻度-90);
var 针尾度数=(Math.PI/180)*(刻度+90);
paint.setARGB(255,255,255,0);
paint.setStrokeWidth(1);
canvas.drawLine(90*Math.cos(针尾度数)+540,90*Math.sin(针尾度数)+540,300*Math.cos(度数)+540,300*Math.sin(度数)+540,paint);
刻度=时间.getMilliseconds()*(360/1000);
度数=(Math.PI/180)*(刻度-90);
var 针尾度数=(Math.PI/180)*(刻度+90);
paint.setARGB(255,255,0,255);
paint.setStrokeWidth(1);
canvas.drawLine(80*Math.cos(针尾度数)+540,80*Math.sin(针尾度数)+540,350*Math.cos(度数)+540,350*Math.sin(度数)+540,paint);
canvas.save(Canvas.ALL_SAVE_FLAG);
canvas.restore();
t1=new Date().getTime();
i=parseInt(1000/(t1-t2));
ui.run(function(){
ui.ok.setImageBitmap(bitmap);
ui.text.text(i+"");
});
t2=t1;
}
});
最后由 adman 编辑
开发者

论坛其实现在可以上传文件了

管理员

@admin 怎么传,有什么特殊方法吗

  • 6
    帖子
  • 432
    浏览

与 Auto.js 的连接断开,我们正在尝试重连,请耐心等待