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,