From e1a820d1f99f97bda4e1ab5d55dd98720c442634 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 16 Sep 2021 02:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99GC=E6=89=A9=E5=B1=95=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E5=AF=B9=E9=BD=90draw=E4=BB=AC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/gcExtend.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Zframework/gcExtend.lua b/Zframework/gcExtend.lua index 13cb0565..9e0b4259 100644 --- a/Zframework/gcExtend.lua +++ b/Zframework/gcExtend.lua @@ -1,12 +1,12 @@ local gc=love.graphics local setColor,printf,draw=gc.setColor,gc.printf,gc.draw local GC={} -function GC.mStr(obj,x,y)printf(obj,x-626,y,1252,'center')end -function GC.simpX(obj,x,y)draw(obj,x-obj:getWidth()*.5,y)end -function GC.simpY(obj,x,y)draw(obj,x,y-obj:getHeight()*.5)end -function GC.X(obj,x,y,a,k)draw(obj,x,y,a,k,nil,obj:getWidth()*.5,0)end -function GC.Y(obj,x,y,a,k)draw(obj,x,y,a,k,nil,0,obj:getHeight()*.5)end -function GC.draw(obj,x,y,a,k)draw(obj,x,y,a,k,nil,obj:getWidth()*.5,obj:getHeight()*.5)end +function GC.mStr(obj,x,y)printf(obj,x-626,y,1252,'center')end--Printf a string with 'center' +function GC.simpX(obj,x,y)draw(obj,x-obj:getWidth()*.5,y)end--Simply draw an obj with x=obj:getWidth()/2 +function GC.simpY(obj,x,y)draw(obj,x,y-obj:getHeight()*.5)end--Simply draw an obj with y=obj:getWidth()/2 +function GC.X(obj,x,y,a,k)draw(obj,x,y,a,k,nil,obj:getWidth()*.5,0)end--Draw an obj with x=obj:getWidth()/2 +function GC.Y(obj,x,y,a,k)draw(obj,x,y,a,k,nil,0,obj:getHeight()*.5)end--Draw an obj with y=obj:getWidth()/2 +function GC.draw(obj,x,y,a,k)draw(obj,x,y,a,k,nil,obj:getWidth()*.5,obj:getHeight()*.5)end--Draw an obj with both middle X & Y function GC.outDraw(obj,div,x,y,a,k) local w,h=obj:getWidth()*.5,obj:getHeight()*.5 draw(obj,x-div,y-div,a,k,nil,w,h)