整理代码,部分玩家绘制材质移动到TEXTURE模块
触屏设置界面绘制完整的玩家边框
This commit is contained in:
@@ -3,7 +3,6 @@ local getColor,setColor=gc.getColor,gc.setColor
|
||||
|
||||
local int,rnd=math.floor,math.random
|
||||
local ins,rem=table.insert,table.remove
|
||||
local getFont=FONT.get
|
||||
local draw=gc.draw
|
||||
|
||||
local texts={}
|
||||
@@ -104,7 +103,7 @@ end
|
||||
function TEXT.show(text,x,y,font,style,spd,stop)
|
||||
ins(texts,{
|
||||
c=0, --Timer
|
||||
text=gc.newText(getFont(int(font/5)*5 or 40),text), --String
|
||||
text=gc.newText(FONT.get(int(font/5)*5 or 40),text), --String
|
||||
x=x or 0, --X
|
||||
y=y or 0, --Y
|
||||
spd=(spd or 1)/60, --Timing speed(1=last 1 sec)
|
||||
@@ -115,7 +114,7 @@ end
|
||||
function TEXT.getText(text,x,y,font,style,spd,stop)--Another version of TEXT.show(), but only return text object, need manual management
|
||||
return{
|
||||
c=0,
|
||||
text=gc.newText(getFont(int(font/5)*5 or 40),text),
|
||||
text=gc.newText(FONT.get(int(font/5)*5 or 40),text),
|
||||
x=x or 0,
|
||||
y=y or 0,
|
||||
spd=(spd or 1)/60,
|
||||
|
||||
@@ -2,13 +2,9 @@ return{
|
||||
color=COLOR.cyan,
|
||||
env={
|
||||
drop=30,lock=45,
|
||||
visible='easy',
|
||||
freshLimit=10,
|
||||
mesDisp=function(P)
|
||||
mText(drawableText.techrash,63,420)
|
||||
setFont(75)
|
||||
mStr(P.stat.clears[4],63,340)
|
||||
end,
|
||||
visible='easy',
|
||||
mesDisp=require"parts.eventsets.blindMesDisp".mesDisp,
|
||||
eventSet='checkLine_200',
|
||||
bg='glow',bgm='push',
|
||||
},
|
||||
|
||||
@@ -31,37 +31,15 @@ local hideBoardStencil={
|
||||
down=function()gc_rectangle('fill',0,-300,300,300,6)end,
|
||||
all=function()gc_rectangle('fill',0,-600,300,600,6)end,
|
||||
}
|
||||
local dialFrame=GC.DO{80,80,
|
||||
{'setLW',3},
|
||||
{'dCirc',40,40,38},
|
||||
}
|
||||
local dialNeedle=GC.DO{32,3,
|
||||
{'setLW',3},
|
||||
{'fRect',0,0,32,3,2},
|
||||
{'setCL',1,.3,.3},
|
||||
{'fRect',0,0,12,3,2},
|
||||
}
|
||||
local multiple=GC.DO{15,15,
|
||||
{'setLW',3},
|
||||
{'line',2,2,12,12},
|
||||
{'line',2,12,12,2},
|
||||
}
|
||||
local playerborder=GC.DO{334,620,
|
||||
{'setLW',2},
|
||||
{'setCL',.97,.97,.97},
|
||||
{'dRect',16,1,302,618,5},
|
||||
{'fRect',17,612,300,2},
|
||||
{'dRect',318,10,15,604,3},
|
||||
{'dRect',1,10,15,604,3},
|
||||
}
|
||||
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=GC.DO(L)
|
||||
end
|
||||
local dialFrame=TEXTURE.dial.frame
|
||||
local dialNeedle=TEXTURE.dial.needle
|
||||
local multiple=TEXTURE.multiple
|
||||
local playerborder=TEXTURE.playerBorder
|
||||
gridLines=TEXTURE.gridLines
|
||||
|
||||
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 function _boardTransform(mode)
|
||||
if mode then
|
||||
if mode=="U-D"then
|
||||
|
||||
@@ -87,7 +87,7 @@ end
|
||||
function scene.draw()
|
||||
gc.setColor(COLOR.Z)
|
||||
gc.setLineWidth(3)
|
||||
gc.rectangle('line',490,65,300,610)
|
||||
gc.draw(TEXTURE.playerBorder,473,63)
|
||||
VK.preview(selected)
|
||||
local x1,y1=SCR.xOy:inverseTransformPoint(0,0)
|
||||
local x2,y2=SCR.xOy:inverseTransformPoint(SCR.w,SCR.h)
|
||||
|
||||
@@ -7,50 +7,52 @@ local function NSC(x,y)--New & Set Canvas
|
||||
end
|
||||
local TEXTURE={}
|
||||
|
||||
gc.origin()
|
||||
|
||||
gc.setDefaultFilter('nearest','nearest')
|
||||
|
||||
--Mini blocks
|
||||
gc.setColor(1,1,1)
|
||||
TEXTURE.miniBlock={}
|
||||
for i=1,29 do
|
||||
local b=BLOCKS[i][0]
|
||||
TEXTURE.miniBlock[i]=NSC(#b[1],#b)
|
||||
for y=1,#b do for x=1,#b[1]do
|
||||
if b[y][x]then
|
||||
gc.rectangle('fill',x-1,#b-y,1,1)
|
||||
end
|
||||
end end
|
||||
|
||||
TEXTURE.miniBlock={}--29 mini blocks image
|
||||
do
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,29 do
|
||||
local b=BLOCKS[i][0]
|
||||
TEXTURE.miniBlock[i]=NSC(#b[1],#b)
|
||||
for y=1,#b do for x=1,#b[1]do
|
||||
if b[y][x]then
|
||||
gc.rectangle('fill',x-1,#b-y,1,1)
|
||||
end
|
||||
end end
|
||||
end
|
||||
end
|
||||
|
||||
--Texture of puzzle mode
|
||||
gc.setLineWidth(2)
|
||||
TEXTURE.puzzleMark={}
|
||||
for i=1,17 do
|
||||
TEXTURE.puzzleMark[i]=GC.DO{30,30,
|
||||
{'setLW',2},
|
||||
{'setCL',minoColor[i][1],minoColor[i][2],minoColor[i][3],.7},
|
||||
{'dRect',5,5,20,20},
|
||||
{'dRect',10,10,10,10},
|
||||
TEXTURE.puzzleMark={}--Texture for puzzle mode
|
||||
do
|
||||
gc.setLineWidth(2)
|
||||
for i=1,17 do
|
||||
TEXTURE.puzzleMark[i]=GC.DO{30,30,
|
||||
{'setLW',2},
|
||||
{'setCL',minoColor[i][1],minoColor[i][2],minoColor[i][3],.7},
|
||||
{'dRect',5,5,20,20},
|
||||
{'dRect',10,10,10,10},
|
||||
}
|
||||
end
|
||||
for i=18,24 do
|
||||
TEXTURE.puzzleMark[i]=GC.DO{30,30,
|
||||
{'setCL',minoColor[i]},
|
||||
{'dRect',7,7,16,16},
|
||||
}
|
||||
end
|
||||
TEXTURE.puzzleMark[-1]=GC.DO{30,30,
|
||||
{'setCL',1,1,1,.8},
|
||||
{'draw',GC.DO{30,30,
|
||||
{'setLW',3},
|
||||
{'line',5,5,25,25},
|
||||
{'line',5,25,25,5},
|
||||
}}
|
||||
}
|
||||
end
|
||||
for i=18,24 do
|
||||
TEXTURE.puzzleMark[i]=GC.DO{30,30,
|
||||
{'setCL',minoColor[i]},
|
||||
{'dRect',7,7,16,16},
|
||||
}
|
||||
end
|
||||
TEXTURE.puzzleMark[-1]=GC.DO{30,30,
|
||||
{'setCL',1,1,1,.8},
|
||||
{'draw',GC.DO{30,30,
|
||||
{'setLW',3},
|
||||
{'line',5,5,25,25},
|
||||
{'line',5,25,25,5},
|
||||
}}
|
||||
}
|
||||
|
||||
--A simple pixel font
|
||||
TEXTURE.pixelNum={}
|
||||
TEXTURE.pixelNum={}--A simple pixel font
|
||||
for i=0,9 do
|
||||
TEXTURE.pixelNum[i]=GC.DO{5,9,
|
||||
{('1011011111'):byte(i+1)>48,'fRect',1,0,3,1},--up
|
||||
@@ -63,52 +65,95 @@ for i=0,9 do
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
gc.setDefaultFilter('linear','linear')
|
||||
|
||||
--Title image
|
||||
local titleTriangles={}
|
||||
for i=1,8 do titleTriangles[i]=love.math.triangulate(title[i])end
|
||||
TEXTURE.title=NSC(1160,236)--Middle: 580,118
|
||||
for i=1,8 do
|
||||
gc.translate(12*i,i==1 and 8 or 14)
|
||||
|
||||
gc.setLineWidth(16)
|
||||
gc.setColor(COLOR.Z)
|
||||
gc.polygon('line',title[i])
|
||||
TEXTURE.title=NSC(1160,236)--Title image (Middle: 580,118)
|
||||
do
|
||||
for i=1,8 do
|
||||
local triangles=love.math.triangulate(title[i])
|
||||
|
||||
gc.setColor(.2,.2,.2)
|
||||
for j=1,#titleTriangles[i]do
|
||||
gc.polygon('fill',titleTriangles[i][j])
|
||||
gc.translate(12*i,i==1 and 8 or 14)
|
||||
|
||||
gc.setLineWidth(16)
|
||||
gc.setColor(COLOR.Z)
|
||||
gc.polygon('line',title[i])
|
||||
|
||||
gc.setColor(.2,.2,.2)
|
||||
for j=1,#triangles do
|
||||
gc.polygon('fill',triangles[j])
|
||||
end
|
||||
|
||||
gc.translate(-12*i,i==1 and -8 or -14)
|
||||
end
|
||||
|
||||
gc.translate(-12*i,i==1 and -8 or -14)
|
||||
end
|
||||
local titleColor={COLOR.lP,COLOR.lC,COLOR.lB,COLOR.lO,COLOR.lF,COLOR.lM,COLOR.lG,COLOR.lY}
|
||||
TEXTURE.title_color=NSC(1160,236)
|
||||
for i=1,8 do
|
||||
gc.translate(12*i,i==1 and 8 or 14)
|
||||
|
||||
gc.setLineWidth(16)
|
||||
gc.setColor(COLOR.Z)
|
||||
gc.polygon('line',title[i])
|
||||
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(COLOR.D)
|
||||
for j=1,#titleTriangles[i]do
|
||||
gc.polygon('fill',titleTriangles[i][j])
|
||||
end
|
||||
|
||||
gc.setColor(.2+.8*titleColor[i][1],.2+.8*titleColor[i][2],.2+.8*titleColor[i][3],.5)
|
||||
gc.translate(-4,-4)
|
||||
for j=1,#titleTriangles[i]do
|
||||
gc.polygon('fill',titleTriangles[i][j])
|
||||
end
|
||||
gc.translate(4,4)
|
||||
|
||||
gc.translate(-12*i,i==1 and -8 or -14)
|
||||
end
|
||||
|
||||
--Sure mark
|
||||
TEXTURE.title_color=NSC(1160,236)--Title image (colored)
|
||||
do
|
||||
local titleColor={COLOR.lP,COLOR.lC,COLOR.lB,COLOR.lO,COLOR.lF,COLOR.lM,COLOR.lG,COLOR.lY}
|
||||
|
||||
for i=1,8 do
|
||||
local triangles=love.math.triangulate(title[i])
|
||||
|
||||
gc.translate(12*i,i==1 and 8 or 14)
|
||||
|
||||
gc.setLineWidth(16)
|
||||
gc.setColor(COLOR.Z)
|
||||
gc.polygon('line',title[i])
|
||||
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(COLOR.D)
|
||||
for j=1,#triangles do
|
||||
gc.polygon('fill',triangles[j])
|
||||
end
|
||||
|
||||
gc.setColor(.2+.8*titleColor[i][1],.2+.8*titleColor[i][2],.2+.8*titleColor[i][3],.5)
|
||||
gc.translate(-4,-4)
|
||||
for j=1,#triangles do
|
||||
gc.polygon('fill',triangles[j])
|
||||
end
|
||||
gc.translate(4,4)
|
||||
|
||||
gc.translate(-12*i,i==1 and -8 or -14)
|
||||
end
|
||||
end
|
||||
|
||||
TEXTURE.multiple=GC.DO{15,15,
|
||||
{'setLW',3},
|
||||
{'line',2,2,12,12},
|
||||
{'line',2,12,12,2},
|
||||
}
|
||||
|
||||
TEXTURE.playerBorder=GC.DO{334,620,
|
||||
{'setLW',2},
|
||||
{'setCL',.97,.97,.97},
|
||||
{'dRect',16,1,302,618,5},
|
||||
{'fRect',17,612,300,2},
|
||||
{'dRect',318,10,15,604,3},
|
||||
{'dRect',1,10,15,604,3},
|
||||
}
|
||||
|
||||
TEXTURE.gridLines=(function()
|
||||
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
|
||||
return GC.DO(L)
|
||||
end)()
|
||||
|
||||
TEXTURE.dial={
|
||||
frame=GC.DO{80,80,
|
||||
{'setLW',3},
|
||||
{'dCirc',40,40,38},
|
||||
},
|
||||
needle=GC.DO{32,3,
|
||||
{'setLW',3},
|
||||
{'fRect',0,0,32,3,2},
|
||||
{'setCL',1,.3,.3},
|
||||
{'fRect',0,0,12,3,2},
|
||||
}
|
||||
}
|
||||
|
||||
TEXTURE.sure=GC.DO{48,64,
|
||||
{'fRect',0,0,10,27},
|
||||
{'fRect',0,0,48,10},
|
||||
@@ -118,7 +163,6 @@ TEXTURE.sure=GC.DO{48,64,
|
||||
{'fRect',18,53,11,11},
|
||||
}
|
||||
|
||||
--Setting icon
|
||||
TEXTURE.setting=GC.DO{64,64,
|
||||
{'setLW',8},
|
||||
{'dCirc',32,32,18},
|
||||
@@ -133,7 +177,6 @@ TEXTURE.setting=GC.DO{64,64,
|
||||
{'line',45,19,55,9},
|
||||
}
|
||||
|
||||
--Music mark
|
||||
TEXTURE.music=GC.DO{64,64,
|
||||
{'setLW',6},
|
||||
{'line',19,9,60,7},
|
||||
@@ -144,14 +187,12 @@ TEXTURE.music=GC.DO{64,64,
|
||||
{'fElps',50,47,11,8},
|
||||
}
|
||||
|
||||
--Mute mark
|
||||
TEXTURE.mute=GC.DO{64,64,
|
||||
{'mDraw',TEXTURE.music,32,32,0,.9},
|
||||
{'setLW',4},
|
||||
{'line',6,6,57,57},
|
||||
}
|
||||
|
||||
--Language mark
|
||||
TEXTURE.language=GC.DO{64,64,
|
||||
{'setLW',2},
|
||||
{'dCirc',32,32,30},
|
||||
@@ -161,7 +202,6 @@ TEXTURE.language=GC.DO{64,64,
|
||||
{'dArc',53,31,40,2.3,3.9},
|
||||
}
|
||||
|
||||
--Info. mark
|
||||
TEXTURE.info=GC.DO{50,50,
|
||||
{'setLW',3},
|
||||
{'dCirc',25,25,22},
|
||||
@@ -169,7 +209,6 @@ TEXTURE.info=GC.DO{50,50,
|
||||
{'fRect',22,20,6,20},
|
||||
}
|
||||
|
||||
--Question mark
|
||||
TEXTURE.question=GC.DO{50,50,
|
||||
{'setLW',3},
|
||||
{'dCirc',25,25,22},
|
||||
@@ -177,14 +216,12 @@ TEXTURE.question=GC.DO{50,50,
|
||||
{'mText','?',26,-1},
|
||||
}
|
||||
|
||||
--More mark
|
||||
TEXTURE.more=GC.DO{60,15,
|
||||
{'fCirc',10,7,6},
|
||||
{'fCirc',30,7,6},
|
||||
{'fCirc',50,7,6},
|
||||
}
|
||||
|
||||
--Back mark
|
||||
TEXTURE.back=GC.DO{60,55,
|
||||
{'setLW',6},
|
||||
{'line',11,10,40,10},
|
||||
@@ -194,7 +231,6 @@ TEXTURE.back=GC.DO{60,55,
|
||||
{'line',20,50,10,40,20,30},
|
||||
}
|
||||
|
||||
--Quit mark
|
||||
TEXTURE.quit=GC.DO{50,50,
|
||||
{'setCL',1,1,1},
|
||||
{'draw',GC.DO{50,50,
|
||||
@@ -204,7 +240,6 @@ TEXTURE.quit=GC.DO{50,50,
|
||||
}}
|
||||
}
|
||||
|
||||
--Quit mark (small)
|
||||
TEXTURE.quit_small=GC.DO{30,30,
|
||||
{'setCL',1,1,1},
|
||||
{'draw',GC.DO{30,30,
|
||||
@@ -214,13 +249,12 @@ TEXTURE.quit_small=GC.DO{30,30,
|
||||
}}
|
||||
}
|
||||
|
||||
TEXTURE.game={
|
||||
TEXTURE.game={--In-game icons
|
||||
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={
|
||||
TEXTURE.rep={--Replay speed buttons
|
||||
rep0=GC.DO{50,50,{'fRect',11,8,8,34},{'fRect',31,8,8,34}},
|
||||
repP8=GC.DO{50,50,{'setFT',15},{'mText',"0.125x",25,15}},
|
||||
repP2=GC.DO{50,50,{'setFT',25},{'mText',"0.5x",25,8}},
|
||||
|
||||
Reference in New Issue
Block a user