From 18d1c2c9ca1ad1b705e3c685e0652bfd3d8a1bac Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Tue, 17 Dec 2024 15:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=86=E6=9E=B6=E8=B7=9F=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zenitha | 2 +- assets/progress.lua | 4 ++-- main.lua | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Zenitha b/Zenitha index 6c1652be..65dbaa5b 160000 --- a/Zenitha +++ b/Zenitha @@ -1 +1 @@ -Subproject commit 6c1652be8c8ccf5af68eccad0b2b24cb5e7cef30 +Subproject commit 65dbaa5b0acd62f484c7f7b2043f09f0cfacc654 diff --git a/assets/progress.lua b/assets/progress.lua index 6f451b70..887fbd77 100644 --- a/assets/progress.lua +++ b/assets/progress.lua @@ -241,7 +241,7 @@ function PROGRESS.applyEnv(env) PROGRESS.applyInteriorBGM() ZENITHA.globalEvent.touchClick=NULL ZENITHA.globalEvent.mouseDown=function(x,y) SYSFX.rectRipple(.26,x-10,y-10,20,20) end - function ZENITHA.globalEvent.drawCursor(_,x,y) + function ZENITHA.globalEvent.drawCursor(x,y) if not SETTINGS.system.sysCursor then gc.setColor(1,1,1) gc.setLineWidth(2) @@ -265,7 +265,7 @@ function PROGRESS.applyEnv(env) else SYSFX.ripple(.26,x,y,26,.62,1,1) end end - function ZENITHA.globalEvent.drawCursor(_,x,y) + function ZENITHA.globalEvent.drawCursor(x,y) if not SETTINGS.system.sysCursor then gc.setColor(1,1,1) gc.setLineWidth(2) diff --git a/main.lua b/main.lua index a489bd98..7ab85e22 100644 --- a/main.lua +++ b/main.lua @@ -221,6 +221,38 @@ FONT.load{ FONT.setDefaultFallback('symbols') FONT.setDefaultFont('norm') SCR.setSize(1600,1000) +local bFill=WIDGET.newClass('button_fill','button') do + local gc=love.graphics + function bFill:draw() + gc.push('transform') + gc.translate(self._x,self._y) + + if self._pressTime>0 then + gc.scale(1-self._pressTime/self._pressTimeMax*.0626) + end + + local w,h=self.w,self.h + local HOV=self._hoverTime/self._hoverTimeMax + + local c=self.fillColor + local r,g,b=c[1],c[2],c[3] + + -- Rectangle + gc.setColor(.15+r*.7*(1-HOV*.26),.15+g*.7*(1-HOV*.26),.15+b*.7*(1-HOV*.26),.9) + GC.mRect('fill',0,0,w,h,self.cornerR) + + -- Drawable + if self._image then + gc.setColor(1,1,1) + WIDGET._alignDraw(self,self._image) + end + if self._text then + gc.setColor(self.textColor) + WIDGET._alignDraw(self,self._text) + end + gc.pop() + end +end WIDGET.setDefaultOption{ base={ lineWidth=2,