-
Notifications
You must be signed in to change notification settings - Fork 2
/
cscreen.min.lua
1 lines (1 loc) · 907 Bytes
/
cscreen.min.lua
1
local a={}local b,c,d=800,600,true;local e,f,g,h=800,600,1.0,1.0;local i,j,k,l=0.0,0.0,800,600;local m,n,o,p=0,0,0,255;function a.init(q,r,s)b=q or 800;c=r or 600;d=s or true;i=0;j=0;a.update(love.graphics.getWidth(),love.graphics.getHeight())end;function a.cease()local pr,pg,pb,pa=love.graphics.getColor()love.graphics.setColor(m,n,o,p)love.graphics.scale(h,h)if i~=0 then love.graphics.rectangle("fill",-i,0,i,l)love.graphics.rectangle("fill",e,0,i,l)elseif j~=0 then love.graphics.rectangle("fill",0,-j,k,j)love.graphics.rectangle("fill",0,f,k,j)end;love.graphics.setColor(pr,pg,pb,pa)end;function a.apply()if d then love.graphics.translate(i,j)end;love.graphics.scale(g,g)end;function a.update(t,u)local v=t/b;local w=u/c;g=math.min(v,w)h=1/g;if d and g==v then i=0;j=u/2-c*g/2 elseif d and g==w then j=0;i=t/2-b*g/2 end;k=t;l=u;e=b*g;f=c*g end;function a.setColor(x,y,z,A)m=x;n=y;o=z;p=A end;return a