Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function btnCon(pH1,pH2,pW1,pW2,pCMD,pTxt)
- btn={}
- btn.HBounds={H1=pH1,H2=pH2}
- btn.WBounds={W1=pW1,W2=pW2}
- btn.CMD=pCMD
- btn.Txt=pTxt
- btn.Enabled=false
- return btn
- end
- function draw(pHBounds,pWBounds,pText)
- d.setBackgroundColor(colors.red)
- for y=pHBounds.H1,pHBounds.H2 do
- for x=pWBounds.W1,pWBounds.W2 do
- d.setCursorPos(x,y)
- if y==pHbounds.H1+2 and x==pWBounds.W1+2 then
- d.write("pText")
- else
- d.write(" ")
- end
- end
- end
- end
- function ClearAndReset()
- d.setBackgroundColor(colors.black)
- for x=1,39 do
- for y=1,29 do
- d.setCursorPos(x,y)
- d.write(" ")
- end
- end
- d.clear()
- end
- btns={}
- btns[1]=btnCon(2,6,15,25,"2,F","F")
- btns[2]=btnCon(14,18,15,25,"5,B","B")
- btns[3]=btnCon(8,12,28,38,"3,R","R")
- btns[4]=btnCon(8,12,2,12,"4,L","L")
- d = peripheral.wrap("top")
- d.setCursorPos(1,1)
- d.write("1")
- ClearAndReset()
- d.write("2")
- for z=1,4 do
- b=btns[z]
- d.write(b.HBounds.H1.." "..b.HBounds.H2)
- -- draw(b.HBounds,b.WBounds,b.Txt)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement