-
Notifications
You must be signed in to change notification settings - Fork 0
/
zoompos.lua~
executable file
·85 lines (52 loc) · 1.56 KB
/
zoompos.lua~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
local exitQuad = {x=64, y=17*64, w=64, h=64}
local function exitZP()
print('exit zp ')
toPaintMode()
end
local screenPos = createbrushbox(100,100,200,200)
local wExitZP = createpicbutton(0,0,buttonsPic,exitZP,exitQuad)
--local wToBSS = createpicbutton(uiw-64,uih-64,buttonsPic,toBrushSourceSelection,exitQuad)
--local wStamp = createpicbutton(uiw-64,0,buttonsPic,stampSelection,exitQuad)
local widgets={}
table.insert(widgets,wExitZP)
table.insert(widgets,wToBSS)
table.insert(widgets,screenPos )
table.insert(widgets,wStamp)
local function rendertouicanvas()
love.graphics.setCanvas(ui)
love.graphics.clear(0.5,0.5,0.5,1.0)
love.graphics.setColor(1.,1.,1.,1.0)
love.graphics.rectangle('fill',screenPos.x,screenPos.y,screenPos.w,screenPos.h)
renderWidgets(widgets)
msgToCvs()
--love.graphics.print()
love.graphics.setCanvas()
end
local function zoomPosDraw()
rendertouicanvas()
--this is the background image of our paint
love.graphics.clear(.5,.5,.5,1.0)
--love.graphics.clear(1.,1.,1.,1.0)
love.graphics.setColor(1.0,1.0,1.0,1.0)
love.graphics.draw(ui,0,0,0,scrsx,scrsy)
end
local function zoomPosUpdate()
if npress==true then
-- print('bs click')
-- addMsg('bs click')
consumed=consumeClick(widgets)
-- print('consumed '..tostring(consumed))brushScreenbrushScreen
if consumed==true
then
return
end
npress=false
end
end
function toZoomPos()
bbsettexture(screenPos,frames[currentIdx].pic)
screenPos.x=offsetcvs.x
screenPos.y=offsetcvs.y
drawFunc=zoomPosDraw
updateFunc=zoomPosUpdate
end