DOGC移入GC拓展模块,GC.DO添加dRPol(圆角正多边形)命令

This commit is contained in:
MrZ626
2021-08-07 14:54:52 +08:00
parent 1d7e58d3bf
commit f6e3b35482
14 changed files with 196 additions and 95 deletions

View File

@@ -1,6 +1,7 @@
local setColor=love.graphics.setColor
local printf=love.graphics.printf
local draw=love.graphics.draw
local gc=love.graphics
local setColor=gc.setColor
local printf=gc.printf
local draw=gc.draw
local GC={}
function GC.str(obj,x,y)printf(obj,x-626,y,1252,'center')end
function GC.simpX(obj,x,y)draw(obj,x-obj:getWidth()*.5,y)end
@@ -31,4 +32,105 @@ function GC.shadedPrint(str,x,y,mode,d,clr1,clr2)
setColor(clr2 or COLOR.Z)
printf(str,x,y,w,mode)
end
do--function GC.DO(L)
local cmds={
origin="origin",
move="translate",
scale="scale",
rotate="rotate",
shear="shear",
clear="clear",
setCL="setColor",
setCM="setColorMask",
setLW="setLineWidth",
setLS="setLineStyle",
setLJ="setLineJoin",
print="print",
setFT=setFont,
mText=GC.str,
mDraw=GC.draw,
mOutDraw=GC.outDraw,
draw="draw",
line="line",
fRect=function(...)gc.rectangle('fill',...)end,
dRect=function(...)gc.rectangle('line',...)end,
fCirc=function(...)gc.circle('fill',...)end,
dCirc=function(...)gc.circle('line',...)end,
fElps=function(...)gc.ellipse('fill',...)end,
dElps=function(...)gc.ellipse('line',...)end,
fPoly=function(...)gc.polygon('fill',...)end,
dPoly=function(...)gc.polygon('line',...)end,
dRPol=function(x,y,R,segments,r,phase)
local X,Y={},{}
local ang=phase or 0
local angStep=6.283185307179586/segments
for i=1,segments do
X[i]=x+R*math.cos(ang)
Y[i]=y+R*math.sin(ang)
ang=ang+angStep
end
X[segments+1]=x+R*math.cos(ang)
Y[segments+1]=y+R*math.sin(ang)
local halfAng=6.283185307179586/segments/2
local erasedLen=r*math.tan(halfAng)
for i=1,segments do
--Line
local x1,y1,x2,y2=X[i],Y[i],X[i+1],Y[i+1]
local dir=math.atan2(y2-y1,x2-x1)
gc.line(x1+erasedLen*math.cos(dir),y1+erasedLen*math.sin(dir),x2-erasedLen*math.cos(dir),y2-erasedLen*math.sin(dir))
--Arc
ang=ang+angStep
local R2=R-r/math.cos(halfAng)
local arcCX,arcCY=x+R2*math.cos(ang),y+R2*math.sin(ang)
gc.arc('line','open',arcCX,arcCY,r,ang-halfAng,ang+halfAng)
end
end,
dPie=function(...)gc.arc('line',...)end,
dArc=function(...)gc.arc('line','open',...)end,
dBow=function(...)gc.arc('line','closed',...)end,
fPie=function(...)gc.arc('fill',...)end,
fArc=function(...)gc.arc('fill','open',...)end,
fBow=function(...)gc.arc('fill','closed',...)end,
}
local sizeLimit=gc.getSystemLimits().texturesize
function GC.DO(L)
gc.push()
::REPEAT_tryAgain::
local success,canvas=pcall(gc.newCanvas,math.min(L[1],sizeLimit),math.min(L[2],sizeLimit))
if not success then
sizeLimit=math.floor(sizeLimit*.8)
goto REPEAT_tryAgain
end
gc.setCanvas(canvas)
gc.origin()
gc.setColor(1,1,1)
gc.setLineWidth(1)
for i=3,#L do
local cmd=L[i][1]
if type(cmd)=='boolean'and cmd then
table.remove(L[i],1)
cmd=L[i][1]
end
if type(cmd)=='string'then
local func=cmds[cmd]
if type(func)=='string'then func=gc[func]end
if func then
func(unpack(L[i],2))
else
error("No gc command: "..cmd)
end
end
end
gc.setCanvas()
gc.pop()
return canvas
end
end
return GC

View File

@@ -25,7 +25,6 @@ VIB= require'Zframework.vibrate'
SFX= require'Zframework.sfx'
LIGHT= require'Zframework.light'
DOGC= require'Zframework.doGC'
BG= require'Zframework.background'
WIDGET= require'Zframework.widget'
TEXT= require'Zframework.text'
@@ -66,7 +65,7 @@ joysticks={}
local devMode
local batteryImg=DOGC{31,20,
local batteryImg=GC.DO{31,20,
{'fRect',1,0,26,2},
{'fRect',1,18,26,2},
{'fRect',0,1,2,18},
@@ -496,28 +495,28 @@ local wsBottomImage do
ins(L,{'setCL',1,1,1,i*.005})
ins(L,{'fRect',i,0,1,18})
end
wsBottomImage=DOGC(L)
wsBottomImage=GC.DO(L)
end
local ws_deadImg=DOGC{20,20,
local ws_deadImg=GC.DO{20,20,
{'setFT',20},
{'setCL',1,.3,.3},
{'print',"X",3,-4},
}
local ws_connectingImg=DOGC{20,20,
local ws_connectingImg=GC.DO{20,20,
{'setLW',3},
{'dArc',11.5,10,6.26,1,5.28},
}
local ws_runningImg=DOGC{20,20,
local ws_runningImg=GC.DO{20,20,
{'setFT',20},
{'setCL',.5,1,0},
{'print',"R",3,-4},
}
local cursorImg=DOGC{16,16,
local cursorImg=GC.DO{16,16,
{'fCirc',8,8,4},
{'setCL',1,1,1,.7},
{'fCirc',8,8,6},
}
local cursor_holdImg=DOGC{16,16,
local cursor_holdImg=GC.DO{16,16,
{'setLW',2},
{'dCirc',8,8,7},
{'fCirc',8,8,3},

View File

@@ -6,7 +6,7 @@ local ins,rem=table.insert,table.remove
local mesList={}
local mesIcon={
check=DOGC{40,40,
check=GC.DO{40,40,
{'setLW',10},
{'setCL',0,0,0},
{'line',4,19,15,30,36,9},
@@ -14,7 +14,7 @@ local mesIcon={
{'setCL',.7,1,.6},
{'line',5,20,15,30,35,10},
},
info=DOGC{40,40,
info=GC.DO{40,40,
{'setCL',.2,.25,.85},
{'fCirc',20,20,15},
{'setCL',1,1,1},
@@ -23,7 +23,7 @@ local mesIcon={
{'fRect',18,11,4,4},
{'fRect',18,17,4,12},
},
broadcast=DOGC{40,40,
broadcast=GC.DO{40,40,
{'setCL',1,1,1},
{'fRect',2,4,36,26,3},
{'fPoly',2,27,2,37,14,25},
@@ -31,7 +31,7 @@ local mesIcon={
{'fRect',6,11,4,4},{'fRect',14,11,19,4},
{'fRect',6,19,4,4},{'fRect',14,19,19,4},
},
warn=DOGC{40,40,
warn=GC.DO{40,40,
{'setCL',.95,.83,.4},
{'fPoly',20.5,1,0,38,40,38},
{'setCL',0,0,0},
@@ -42,7 +42,7 @@ local mesIcon={
{'fRect',18,11,5,16},
{'fRect',18,30,5,5},
},
error=DOGC{40,40,
error=GC.DO{40,40,
{'setCL',.95,.3,.3},
{'fCirc',20,20,19},
{'setCL',0,0,0},
@@ -92,7 +92,7 @@ function MES.new(icon,str,time)
startTime=.5,
endTime=.5,
time=time or 3,
canvas=DOGC(L),
canvas=GC.DO(L),
width=w,height=h,
scale=h>400 and 1/math.min(h/400,2.6)or 1
})

View File

@@ -19,22 +19,22 @@ local getFont,setFont,mStr=getFont,setFont,mStr
local mDraw,mDraw_X,mDraw_Y=GC.draw,GC.simpX,GC.simpY
local xOy=SCR.xOy
local downArrowIcon=DOGC{40,25,{'fPoly',0,0,20,25,40,0}}
local upArrowIcon=DOGC{40,25,{'fPoly',0,25,20,0,40,25}}
local clearIcon=DOGC{40,40,
local downArrowIcon=GC.DO{40,25,{'fPoly',0,0,20,25,40,0}}
local upArrowIcon=GC.DO{40,25,{'fPoly',0,25,20,0,40,25}}
local clearIcon=GC.DO{40,40,
{'fRect',16,5,8,3},
{'fRect',8,8,24,3},
{'fRect',11,14,18,21},
}
local sureIcon=DOGC{40,40,
local sureIcon=GC.DO{40,40,
{'setFT',35},
{'mText',"?",20,-6},
}
local smallerThen=DOGC{20,20,
local smallerThen=GC.DO{20,20,
{'setLW',5},
{'line',18,2,1,10,18,18},
}
local largerThen=DOGC{20,20,
local largerThen=GC.DO{20,20,
{'setLW',5},
{'line',2,2,19,10,2,18},
}
@@ -1452,7 +1452,7 @@ local widgetCover do
ins(L,{'fRect',0,i,1,2})
ins(L,{'fRect',0,360-i,1,2})
end
widgetCover=DOGC(L)
widgetCover=GC.DO(L)
end
local scr_w,scr_h
function WIDGET.resize(w,h)

View File

@@ -8,7 +8,7 @@ local upCover do
table.insert(L,{'setCL',.6,1,1,i*.01})
table.insert(L,{'fRect',0,63-i,1,1})
end
upCover=DOGC(L)
upCover=GC.DO(L)
end
local downCover do
local L={1,64}
@@ -16,7 +16,7 @@ local downCover do
table.insert(L,{'setCL',1,.5,.8,i*.01})
table.insert(L,{'fRect',0,i,1,1})
end
downCover=DOGC(L)
downCover=GC.DO(L)
end
local W,H

View File

@@ -598,7 +598,7 @@ do--function drawSelfProfile()
ins(img,{"dRect",2,2,21,21})
--TODO: draw with lv
img=DOGC(img)
img=GC.DO(img)
rawset(self,lv,img)
return img
end})

View File

@@ -29,21 +29,21 @@ local hideBoardStencil={
down=function()gc_rectangle('fill',0,300,300,300)end,
all=function()gc_rectangle('fill',0,0,300,600)end,
}
local dialFrame=DOGC{97,32,
local dialFrame=GC.DO{97,32,
{'setLW',2},
{'dRect',1,1,30,30,3},
{'dRect',36,1,60,30,3},
}
local dialNeedle=DOGC{22,4,
local dialNeedle=GC.DO{22,4,
{'fRect',0,1,20,2},
{'fCirc',20,2,2},
}
local multiple=DOGC{15,15,
local multiple=GC.DO{15,15,
{'setLW',3},
{'line',2,2,12,12},
{'line',2,12,12,2},
}
local spinCenterImg=DOGC{9,9,
local spinCenterImg=GC.DO{9,9,
{'setCL',1,1,1,.2},
{'fRect',0,0,9,9},
{'setCL',1,1,1,.6},
@@ -53,7 +53,7 @@ local spinCenterImg=DOGC{9,9,
{'setCL',1,1,1},
{'fRect',3,3,3,3},
}
local playerBoarders=DOGC{334,620,
local playerBoarders=GC.DO{334,620,
{'setLW',2},
{'setCL',.97,.97,.975},
{'dRect',16,1,302,618,7},
@@ -65,15 +65,15 @@ local gridLines do
local L={300,640,{'setLW',2}}
for x=1,9 do table.insert(L,{'line',30*x,0,30*x,640})end
for y=0,20 do table.insert(L,{'line',0,10+30*y,300,10+30*y})end
gridLines=DOGC(L)
gridLines=GC.DO(L)
end
local LDmarks=gc.newSpriteBatch(DOGC{14,5,{'fRect',0,0,14,5,3}},15,'static')
local LDmarks=gc.newSpriteBatch(GC.DO{14,5,{'fRect',0,0,14,5,3}},15,'static')
for i=0,14 do LDmarks:add(3+20*i,615)end
local bpmImage=DOGC{31,12,
local bpmImage=GC.DO{31,12,
{'setFT',15},
{'print',"BPM",0,-5}
}
local kpmImage=DOGC{31,12,
local kpmImage=GC.DO{31,12,
{'setFT',15},
{'print',"KPM",0,-5}
}

View File

@@ -26,13 +26,13 @@ local loadingThread=coroutine.wrap(function()
YIELD('loadModeIcon')
local modeIcons={}
modeIcons.marathon=DOGC{32,32,
modeIcons.marathon=GC.DO{32,32,
{'move',3,1},
{'fRect',10,4,-2,23},
{'fPoly',10,4,24,10,10,16.5},
{'fRect',4,24,10,3},
}
modeIcons.infinite=DOGC{64,64,
modeIcons.infinite=GC.DO{64,64,
{'setLW',4},
{'dCirc',32,32,28},
{'line',32,32,32,14},
@@ -43,14 +43,14 @@ local loadingThread=coroutine.wrap(function()
{'fRect',52,30,4,4},
{'fRect',30,52,4,4},
}
modeIcons.classic=DOGC{64,64,
modeIcons.classic=GC.DO{64,64,
{'setLW',6},
{'dRect',10,24,12,12},
{'dRect',26,24,12,12},
{'dRect',42,24,12,12},
{'dRect',26,40,12,12},
}
modeIcons.tsd=DOGC{64,64,
modeIcons.tsd=GC.DO{64,64,
{'fRect',7,7,16,16},
{'fRect',7,41,16,16},
{'fRect',41,41,16,16},
@@ -58,7 +58,7 @@ local loadingThread=coroutine.wrap(function()
{'setLW',1},
{'dPoly',7,24,56,24,56,39,39,39,39,56,24,56,24,39,7,39},
}
modeIcons.t49=DOGC{64,64,
modeIcons.t49=GC.DO{64,64,
{'setLW',2},
{'dRect',05,05,10,20},{'dRect',49,05,10,20},
{'dRect',05,39,10,20},{'dRect',49,39,10,20},
@@ -66,7 +66,7 @@ local loadingThread=coroutine.wrap(function()
{'setCL',1,1,1,.7},
{'fRect',20,10,23,43},
}
modeIcons.t99=DOGC{64,64,
modeIcons.t99=GC.DO{64,64,
{'setLW',2},
{'dRect',02,02,6,12},{'dRect',11,02,6,12},
{'dRect',02,18,6,12},{'dRect',11,18,6,12},

View File

@@ -100,9 +100,9 @@ scene.widgetList={
WIDGET.newText{name="arrow", x=270, y=360,font=45,align='L'},
WIDGET.newText{name="now", x=700, y=500,font=50,align='R',hideF=function()return not BGM.nowPlay end},
WIDGET.newSlider{name="bgm", x=760, y=80,w=400,disp=SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
WIDGET.newButton{name="up", x=200, y=250,w=120,code=pressKey"up",hideF=function()return selected==1 end,fText=DOGC{32,32,{'setLW',4},{'line',2,28,16,4,30,28}}},
WIDGET.newButton{name="play", x=200, y=390,w=120,code=pressKey"space",fText=DOGC{64,64,{'fPoly',14+3,10,14+3,54,55+3,32}}},
WIDGET.newButton{name="down", x=200, y=530,w=120,code=pressKey"down",hideF=function()return selected==#bgmList end,fText=DOGC{32,32,{'setLW',4},{'line',2,4,16,28,30,4}}},
WIDGET.newButton{name="up", x=200, y=250,w=120,code=pressKey"up",hideF=function()return selected==1 end,fText=GC.DO{32,32,{'setLW',4},{'line',2,28,16,4,30,28}}},
WIDGET.newButton{name="play", x=200, y=390,w=120,code=pressKey"space",fText=GC.DO{64,64,{'fPoly',14+3,10,14+3,54,55+3,32}}},
WIDGET.newButton{name="down", x=200, y=530,w=120,code=pressKey"down",hideF=function()return selected==#bgmList end,fText=GC.DO{32,32,{'setLW',4},{'line',2,4,16,28,30,4}}},
WIDGET.newButton{name="sound", x=1140, y=540,w=170,h=80,font=40,code=pressKey"tab"},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
}

View File

@@ -150,10 +150,10 @@ end
scene.widgetList={
listBox,
WIDGET.newButton{name="export",x=200,y=640,w=70,color='lG',code=pressKey"cC",fText=DOGC{50,50,{'fRect',8,44,34,4},{'fRect',22,17,6,23},{'fPoly',25,5,10,20,40,20}}},
WIDGET.newButton{name="import",x=300,y=640,w=70,color='lN',code=pressKey"cV",fText=DOGC{50,50,{'fRect',8,44,34,4},{'fRect',22,5,6,23},{'fPoly',25,40,10,25,40,25}}},
WIDGET.newButton{name="play",x=700,y=640,w=170,h=80,color='lY',code=pressKey"return",fText=DOGC{50,50,{'fPoly',10,0,49,24,10,49}}},
WIDGET.newButton{name="delete",x=850,y=640,w=80,h=80,color='lR',code=pressKey"delete",fText=DOGC{50,50,{'setLW',8},{'line',5,5,45,45},{'line',5,45,45,5}}},
WIDGET.newButton{name="export",x=200,y=640,w=70,color='lG',code=pressKey"cC",fText=GC.DO{50,50,{'fRect',8,44,34,4},{'fRect',22,17,6,23},{'fPoly',25,5,10,20,40,20}}},
WIDGET.newButton{name="import",x=300,y=640,w=70,color='lN',code=pressKey"cV",fText=GC.DO{50,50,{'fRect',8,44,34,4},{'fRect',22,5,6,23},{'fPoly',25,40,10,25,40,25}}},
WIDGET.newButton{name="play",x=700,y=640,w=170,h=80,color='lY',code=pressKey"return",fText=GC.DO{50,50,{'fPoly',10,0,49,24,10,49}}},
WIDGET.newButton{name="delete",x=850,y=640,w=80,h=80,color='lR',code=pressKey"delete",fText=GC.DO{50,50,{'setLW',8},{'line',5,5,45,45},{'line',5,45,45,5}}},
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
}

View File

@@ -27,21 +27,21 @@ end
gc.setLineWidth(2)
TEXTURE.puzzleMark={}
for i=1,17 do
TEXTURE.puzzleMark[i]=DOGC{30,30,
TEXTURE.puzzleMark[i]=GC.DO{30,30,
{'setCL',minoColor[i][1],minoColor[i][2],minoColor[i][3],.6},
{'dRect',5,5,20,20},
{'dRect',10,10,10,10},
}
end
for i=18,24 do
TEXTURE.puzzleMark[i]=DOGC{30,30,
TEXTURE.puzzleMark[i]=GC.DO{30,30,
{'setCL',minoColor[i]},
{'dRect',7,7,16,16},
}
end
TEXTURE.puzzleMark[-1]=DOGC{30,30,
TEXTURE.puzzleMark[-1]=GC.DO{30,30,
{'setCL',1,1,1,.8},
{'draw',DOGC{30,30,
{'draw',GC.DO{30,30,
{'setLW',3},
{'line',5,5,25,25},
{'line',5,25,25,5},
@@ -51,7 +51,7 @@ TEXTURE.puzzleMark[-1]=DOGC{30,30,
--A simple pixel font
TEXTURE.pixelNum={}
for i=0,9 do
TEXTURE.pixelNum[i]=DOGC{5,9,
TEXTURE.pixelNum[i]=GC.DO{5,9,
{('1011011111'):byte(i+1)>48,'fRect',1,0,3,1},--up
{('0011111011'):byte(i+1)>48,'fRect',1,4,3,1},--middle
{('1011011011'):byte(i+1)>48,'fRect',1,8,3,1},--down
@@ -108,7 +108,7 @@ for i=1,8 do
end
--Sure mark
TEXTURE.sure=DOGC{48,64,
TEXTURE.sure=GC.DO{48,64,
{'fRect',0,0,10,27},
{'fRect',0,0,48,10},
{'fRect',38,10,10,15},
@@ -118,7 +118,7 @@ TEXTURE.sure=DOGC{48,64,
}
--Setting icon
TEXTURE.setting=DOGC{64,64,
TEXTURE.setting=GC.DO{64,64,
{'setLW',8},
{'dCirc',32,32,18},
{'setLW',10},
@@ -133,7 +133,7 @@ TEXTURE.setting=DOGC{64,64,
}
--Music mark
TEXTURE.music=DOGC{64,64,
TEXTURE.music=GC.DO{64,64,
{'setLW',6},
{'line',19,9,60,7},
{'setLW',2},
@@ -144,14 +144,14 @@ TEXTURE.music=DOGC{64,64,
}
--Mute mark
TEXTURE.mute=DOGC{64,64,
TEXTURE.mute=GC.DO{64,64,
{'mDraw',TEXTURE.music,32,32,0,.9},
{'setLW',4},
{'line',6,6,57,57},
}
--Language mark
TEXTURE.language=DOGC{64,64,
TEXTURE.language=GC.DO{64,64,
{'setLW',2},
{'dCirc',32,32,30},
{'line',2,31,62,31},
@@ -161,7 +161,7 @@ TEXTURE.language=DOGC{64,64,
}
--Info. mark
TEXTURE.info=DOGC{50,50,
TEXTURE.info=GC.DO{50,50,
{'setLW',3},
{'dCirc',25,25,22},
{'fRect',22,11,6,6},
@@ -169,7 +169,7 @@ TEXTURE.info=DOGC{50,50,
}
--Question mark
TEXTURE.question=DOGC{50,50,
TEXTURE.question=GC.DO{50,50,
{'setLW',3},
{'dCirc',25,25,22},
{'setFT',40},
@@ -177,14 +177,14 @@ TEXTURE.question=DOGC{50,50,
}
--More mark
TEXTURE.more=DOGC{60,15,
TEXTURE.more=GC.DO{60,15,
{'fCirc',10,7,6},
{'fCirc',30,7,6},
{'fCirc',50,7,6},
}
--Back mark
TEXTURE.back=DOGC{60,55,
TEXTURE.back=GC.DO{60,55,
{'setLW',6},
{'line',11,10,40,10},
{'line',10,40,40,40},
@@ -194,9 +194,9 @@ TEXTURE.back=DOGC{60,55,
}
--Quit mark
TEXTURE.quit=DOGC{50,50,
TEXTURE.quit=GC.DO{50,50,
{'setCL',1,1,1},
{'draw',DOGC{50,50,
{'draw',GC.DO{50,50,
{'setLW',7},
{'line',5,5,45,45},
{'line',5,45,45,5},
@@ -204,9 +204,9 @@ TEXTURE.quit=DOGC{50,50,
}
--Quit mark (small)
TEXTURE.quit_small=DOGC{30,30,
TEXTURE.quit_small=GC.DO{30,30,
{'setCL',1,1,1},
{'draw',DOGC{30,30,
{'draw',GC.DO{30,30,
{'setLW',4},
{'line',2,2,28,28},
{'line',2,28,28,2},
@@ -214,19 +214,19 @@ TEXTURE.quit_small=DOGC{30,30,
}
TEXTURE.game={
restart=DOGC{32,32,{'setLW',3},{'dArc',16,16,11,.7,5.5},{'setLW',2.5},{'line',21,.7,24,8,16,11}},
pause=DOGC{18,23,{'fRect',0,0,3,23},{'fRect',15,0,3,23}},
restart=GC.DO{32,32,{'setLW',3},{'dArc',16,16,11,.7,5.5},{'setLW',2.5},{'line',21,.7,24,8,16,11}},
pause=GC.DO{18,23,{'fRect',0,0,3,23},{'fRect',15,0,3,23}},
}
--Replay speed buttons
TEXTURE.rep={
rep0=DOGC{50,50,{'fRect',11,8,8,34},{'fRect',31,8,8,34}},
repP8=DOGC{50,50,{'setFT',15},{'print',"0.125x",0,15}},
repP2=DOGC{50,50,{'setFT',25},{'print',"0.5x",0,8}},
rep1=DOGC{50,50,{'setFT',30},{'print',"1x",7,3}},
rep2=DOGC{50,50,{'setFT',30},{'print',"2x",7,3}},
rep5=DOGC{50,50,{'setFT',30},{'print',"5x",7,3}},
step=DOGC{50,50,{'setFT',30},{'fRect',12,7,4,36},{'setLW',4},{'line',25,14,41,25,25,36}},
rep0=GC.DO{50,50,{'fRect',11,8,8,34},{'fRect',31,8,8,34}},
repP8=GC.DO{50,50,{'setFT',15},{'print',"0.125x",0,15}},
repP2=GC.DO{50,50,{'setFT',25},{'print',"0.5x",0,8}},
rep1=GC.DO{50,50,{'setFT',30},{'print',"1x",7,3}},
rep2=GC.DO{50,50,{'setFT',30},{'print',"2x",7,3}},
rep5=GC.DO{50,50,{'setFT',30},{'print',"5x",7,3}},
step=GC.DO{50,50,{'setFT',30},{'fRect',12,7,4,36},{'setLW',4},{'line',25,14,41,25,25,36}},
}
gc.setCanvas()

View File

@@ -142,7 +142,7 @@ return STRING.split([=[
REPLAY不再需要保存到本地的数据,每次启动自动刷新录像文件列表
字符串拓展模块和DATA模块新增方法
修复:
DOGC模块创建超过系统限制大小的画布导致报错
GC.DO模块创建超过系统限制大小的画布导致报错
玩家退出房间时移除键错误导致崩溃
0.15.4: 近地轨道 Low Earth Orbit

View File

@@ -9,12 +9,12 @@ local emptyUser={
local defaultAvatar={}
for i=1,29 do
local img=TEXTURE.miniBlock[i]
defaultAvatar[i]=DOGC{128,128,
defaultAvatar[i]=GC.DO{128,128,
{'clear',.1,.1,.1},
{'draw',img,63,63,.2,30,30,img:getWidth()/2,img:getHeight()/2},
}
end
local errorAvatar=DOGC{128,128,
local errorAvatar=GC.DO{128,128,
{'setCL',1,.2,.15},
{'setLW',10},
{'line',10,10,117,117},

View File

@@ -8,31 +8,31 @@ local VK_org=VK_org
local skin=1
local buttonImages={
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98},{'dCirc',100,100,90}},
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98,8},{'dCirc',100,100,90,8}},
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98,6},{'dCirc',100,100,90,6}},
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98,4},{'dCirc',100,100,89,4}},
DOGC{200,200,{'setLW',4},{'dRect',31,31,138,138},{'dRect',39,39,122,122}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98},{'dCirc',100,100,90}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98,8},{'dCirc',100,100,90,8}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98,6},{'dCirc',100,100,90,6}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98,4},{'dCirc',100,100,89,4}},
GC.DO{200,200,{'setLW',4},{'dRect',31,31,138,138},{'dRect',39,39,122,122}},
}
local rippleImages={
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98}},
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98,8}},
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98,6}},
DOGC{200,200,{'setLW',4},{'dCirc',100,100,98,4}},
DOGC{200,200,{'setLW',4},{'dRect',31,31,138,138}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98,8}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98,6}},
GC.DO{200,200,{'setLW',4},{'dCirc',100,100,98,4}},
GC.DO{200,200,{'setLW',4},{'dRect',31,31,138,138}},
}
local holdImages={
DOGC{200,200,{'fCirc',100,100,86}},
DOGC{200,200,{'fCirc',100,100,86,8}},
DOGC{200,200,{'fCirc',100,100,85,6}},
DOGC{200,200,{'fCirc',100,100,83,4}},
DOGC{200,200,{'fRect',43,43,114,114}},
GC.DO{200,200,{'fCirc',100,100,86}},
GC.DO{200,200,{'fCirc',100,100,86,8}},
GC.DO{200,200,{'fCirc',100,100,85,6}},
GC.DO{200,200,{'fCirc',100,100,83,4}},
GC.DO{200,200,{'fRect',43,43,114,114}},
}
--Virtualkey icons
local VKIcon={}
gc.setDefaultFilter('nearest','nearest')
local VKI=gc.newImage("media/image/virtualkey.png")
for i=1,20 do VKIcon[i]=DOGC{36,36,{'draw',VKI,(i-1)%5*-36,math.floor((i-1)*.2)*-36}}end
for i=1,20 do VKIcon[i]=GC.DO{36,36,{'draw',VKI,(i-1)%5*-36,math.floor((i-1)*.2)*-36}}end
gc.setDefaultFilter('linear','linear')
--In-game virtualkey layout data