diff --git a/Zframework/widget.lua b/Zframework/widget.lua index a0a2b5b9..8c38d937 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -1,10 +1,13 @@ local gc=love.graphics -local gc_translate=gc.translate +local gc_push,gc_pop,gc_clear,gc_origin=gc.push,gc.pop,gc.clear,gc.origin +local gc_translate,gc_scale=gc.translate,gc.scale +local gc_setCanvas,gc_setBlendMode=gc.setCanvas,gc.setBlendMode local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth local gc_draw,gc_line=gc.draw,gc.line local gc_rectangle=gc.rectangle local gc_print,gc_printf=gc.print,gc.printf + local kb=love.keyboard local next=next @@ -14,8 +17,8 @@ local sub,ins=string.sub,table.insert local getFont,setFont,mStr=getFont,setFont,mStr local mDraw,mDraw_X,mDraw_Y=ADRAW.draw,ADRAW.simpX,ADRAW.simpY -local downArrowIcon=DOGC{60,30,{'fPoly',0,0,30,30,60,0}} -local upArrowIcon=DOGC{60,30,{'fPoly',0,30,30,0,60,30}} +local downArrowIcon=DOGC{60,35,{'fPoly',0,0,30,35,60,0}} +local upArrowIcon=DOGC{60,35,{'fPoly',0,35,30,0,60,35}} local clearIcon=DOGC{40,40, {'fRect',16,4,8,2}, {'fRect',8,0,24,2}, @@ -1242,23 +1245,47 @@ function WIDGET.update() if W.update then W:update()end end end +local scaleK +local widgetCanvas +local widgetCover do + local L={1280,720,{'fRect',0,40,1280,640}} + for i=0,20 do + ins(L,{'setCL',1,1,1,i/20}) + ins(L,{'fRect',0,2*i,1280,2}) + ins(L,{'fRect',0,720-2*i,1280,2}) + end + widgetCover=DOGC(L) +end function WIDGET.draw() - gc_translate(0,-WIDGET.scrollPos) - for _,W in next,WIDGET.active do - if not W.hide then - W:draw() - end - end - gc_translate(0,WIDGET.scrollPos) - if WIDGET.scrollHeight>0 then - gc_setColor(1,1,1) - if WIDGET.scrollPos>0 then - mDraw(upArrowIcon,640,20) - end - if WIDGET.scrollPos0 then + if WIDGET.scrollPos>0 then mDraw(upArrowIcon,640,25)end + if WIDGET.scrollPos