diff --git a/Zframework/gcExtend.lua b/Zframework/gcExtend.lua index ecf2d263..09969471 100644 --- a/Zframework/gcExtend.lua +++ b/Zframework/gcExtend.lua @@ -1,7 +1,7 @@ local gc=love.graphics local setColor,printf,draw=gc.setColor,gc.printf,gc.draw local GC={} -function GC.str(obj,x,y)printf(obj,x-626,y,1252,'center')end +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 @@ -96,8 +96,10 @@ do--function GC.DO(L) print="print", setFT=function(...)FONT.set(...)end, - mText=GC.str, + mText=GC.mStr, mDraw=GC.draw, + mDrawX=GC.X, + mDrawY=GC.Y, mOutDraw=GC.outDraw, draw="draw", diff --git a/Zframework/init.lua b/Zframework/init.lua index e00c3a51..7daad072 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -45,7 +45,7 @@ LIGHT= require'Zframework.light' --Love-based modules (complex) GC= require'Zframework.gcExtend' - mStr=GC.str + mStr=GC.mStr mText=GC.simpX mDraw=GC.draw FONT= require'Zframework.font' diff --git a/Zframework/message.lua b/Zframework/message.lua index 6b25641b..c2bbafa0 100644 --- a/Zframework/message.lua +++ b/Zframework/message.lua @@ -80,8 +80,8 @@ function MES.new(icon,str,time) icon=mesIcon[icon] end local t=gc.newText(FONT.get(30),str) - local w=math.max(t:getWidth()+(icon and 45 or 5),200)+20 - local h=math.max(t:getHeight(),46)+3 + local w=math.max(t:getWidth()+(icon and 45 or 5),200)+15 + local h=math.max(t:getHeight(),46)+2 local L={w,h, {'clear',backColor}, {'setCL',.7,.7,.7}, @@ -92,7 +92,7 @@ function MES.new(icon,str,time) if icon then ins(L,{'draw',icon,4,4,nil,40/icon:getWidth(),40/icon:getHeight()}) end - ins(L,{'draw',t,icon and 50 or 10,2}) + ins(L,{'mDrawY',t,icon and 50 or 10,h/2}) ins(mesList,{ startTime=.5, @@ -127,7 +127,7 @@ function MES.draw() local m=mesList[i] gc_setColor(1,1,1,2*(m.endTime-m.startTime)) gc_draw(m.canvas,40-80*(m.endTime+m.startTime),0,nil,m.scale) - gc_translate(0,m.height*m.scale+4) + gc_translate(0,m.height*m.scale+2) end end gc_pop()