新增doGC工具函数,三个模式图标改为代码绘制
This commit is contained in:
25
Zframework/doGC.lua
Normal file
25
Zframework/doGC.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local gc=love.graphics
|
||||
local cmds={
|
||||
move="translate",
|
||||
zoom="scale",
|
||||
rgb="setColor",
|
||||
wid="setLineWidth",
|
||||
line="line",
|
||||
rect="rectangle",
|
||||
circ="circle",
|
||||
poly="polygon",
|
||||
}
|
||||
return function(L)
|
||||
gc.push()
|
||||
local canvas=gc.newCanvas(L[1],L[2])
|
||||
gc.setCanvas(canvas)
|
||||
gc.origin()
|
||||
gc.setColor(1,1,1)
|
||||
gc.setLineWidth(1)
|
||||
for i=3,#L do
|
||||
gc[cmds[L[i][1]]](unpack(L[i],2))
|
||||
end
|
||||
gc.setCanvas()
|
||||
gc.pop()
|
||||
return canvas
|
||||
end
|
||||
@@ -26,6 +26,7 @@ VIB= require"Zframework/vibrate"
|
||||
SFX= require"Zframework/sfx"
|
||||
|
||||
LIGHT= require"Zframework/light"
|
||||
DOGC= require"Zframework/doGC"
|
||||
BG= require"Zframework/background"
|
||||
WIDGET= require"Zframework/widget"
|
||||
TEXT= require"Zframework/text"
|
||||
|
||||
Reference in New Issue
Block a user