看了很多csdn上的大神做的绘图工具
深感惭愧
以下是我做的简易的绘图工具
界面干净整洁
左侧图案表示
当前画笔的图形与颜色
右侧图案表示
当前画笔的大小
图案包含三种基本图形
下面介绍一下代码部分
首先是图形
function gui(){
ui.fill(255,255,255)
ui.rect(0,windowHeight-100, 100, 100)
ui.rect(windowWidth-100,windowHeight-100, 100, 100)
ui.fill(0,0,0)
ui.text(dim, windowWidth-50-20,windowHeight-50-16, 100, 100)
ui.fill(c)
if(shape == "circle"){
ui.ellipse(50, windowHeight - 50, 40)
}
else if(shape == "square" ){
ui.rect(50 - 15, windowHeight - 50 - 15, 40, 40)
}
else if(shape == "triangle"){
ui.triangle(5