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)