From e242a89a4bc952cbb3c40ce15f839acff5f48e90 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 24 Apr 2021 16:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/gametoolfunc.lua | 41 +++++++++++++++++++---------------------- parts/scenes/game.lua | 19 +++++++------------ 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index cabb83d3..4827f117 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -1,7 +1,4 @@ local gc=love.graphics -local gc_setColor,gc_setLineWidth,gc_setShader=gc.setColor,gc.setLineWidth,gc.setShader -local gc_push,gc_pop,gc_origin,gc_translate=gc.push,gc.pop,gc.origin,gc.translate -local gc_draw,gc_printf,gc_line,gc_rectangle=gc.draw,gc.printf,gc.line,gc.rectangle @@ -474,42 +471,42 @@ do--function drawFWM() function drawFWM() local t=TIME() setFont(25) - gc_setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t))) + gc.setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t))) mStr(m[_G["\83\69\84\84\73\78\71"]["\108\97\110\103"]or m[1]],240,60+26*sin(t)) end end function drawSelfProfile() local selfAvatar=USERS.getAvatar(USER.uid) - gc_push("transform") - gc_translate(1280,0) + gc.push("transform") + gc.translate(1280,0) --Draw avatar - gc_setLineWidth(2) - gc_setColor(.3,.3,.3,.8)gc_rectangle("fill",-260,0,260,80) - gc_setColor(1,1,1)gc_rectangle("line",-260,0,260,80) - gc_rectangle("line",-73,7,66,66,2) - gc_draw(selfAvatar,-72,8,nil,.5) + gc.setLineWidth(2) + gc.setColor(.3,.3,.3,.8)gc.rectangle("fill",-260,0,260,80) + gc.setColor(1,1,1)gc.rectangle("line",-260,0,260,80) + gc.rectangle("line",-73,7,66,66,2) + gc.draw(selfAvatar,-72,8,nil,.5) --Draw username setFont(30) - gc_printf(USERS.getUsername(USER.uid),-342,5,260,"right") + gc.printf(USERS.getUsername(USER.uid),-342,5,260,"right") --Draw lv. & xp. - gc_draw(TEXTURE.lvIcon[USER.lv],-255,50) - gc_line(-230,55,-80,55,-80,70,-230,70) - gc_rectangle("fill",-230,55,150*USER.xp/USER.lv/USER.lv,15) + gc.draw(TEXTURE.lvIcon[USER.lv],-255,50) + gc.line(-230,55,-80,55,-80,70,-230,70) + gc.rectangle("fill",-230,55,150*USER.xp/USER.lv/USER.lv,15) - gc_pop() + gc.pop() end function drawWarning() if SETTING.warn and GAME.warnLVL>0 then - gc_push("transform") - gc_origin() + gc.push("transform") + gc.origin() SHADER.warning:send("level",GAME.warnLVL) - gc_setShader(SHADER.warning) - gc_rectangle("fill",0,0,SCR.w,SCR.h) - gc_setShader() - gc_pop() + gc.setShader(SHADER.warning) + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.setShader() + gc.pop() end end diff --git a/parts/scenes/game.lua b/parts/scenes/game.lua index 0e62f769..edd91e1f 100644 --- a/parts/scenes/game.lua +++ b/parts/scenes/game.lua @@ -1,11 +1,6 @@ -local gc=love.graphics -local gc_setColor=gc.setColor -local tc=love.touch - +local gc,tc=love.graphics,love.touch local sin=math.sin - -local SCR=SCR -local VK=VK +local SCR,VK=SCR,VK local noTouch,noKey=false,false local touchMoveLastFrame=false @@ -166,10 +161,10 @@ local function drawAtkPointer(x,y) local a=t*3%1*.8 t=sin(t*20) - gc_setColor(.2,.7+t*.2,1,.6+t*.4) + gc.setColor(.2,.7+t*.2,1,.6+t*.4) gc.circle("fill",x,y,25,6) - gc_setColor(0,.6,1,.8-a) + gc.setColor(0,.6,1,.8-a) gc.circle("line",x,y,30*(1+a),6) end function scene.draw() @@ -187,7 +182,7 @@ function scene.draw() if GAME.modeEnv.royaleMode then local P=PLAYERS[1] gc.setLineWidth(5) - gc_setColor(.8,1,0,.2) + gc.setColor(.8,1,0,.2) for i=1,#P.atker do local p=P.atker[i] gc.line(p.centerX,p.centerY,P.x+300*P.size,P.y+670*P.size) @@ -205,12 +200,12 @@ function scene.draw() end --Mode info - gc_setColor(1,1,1,.8) + gc.setColor(1,1,1,.8) gc.draw(drawableText.modeName,485,10) --Replaying if GAME.replaying then - gc_setColor(1,1,TIME()%1>.5 and 1 or 0) + gc.setColor(1,1,TIME()%1>.5 and 1 or 0) mText(drawableText.replaying,770,17) end