Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DisplayLib = {}
- function DisplayLib.initDisplay(mon)
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- x1,y1 = mon.getSize()
- bt = {}
- for x=1,x1 do
- bt[x]={}
- for y=1,y1 do
- bt[x][y] = nil
- end
- end
- return bt
- end
- function DisplayLib.drawButton(screen, color1, color2, x, y, xsize, ysize,xtext,ytext,text, funcCall, mon)
- mon.setTextColor(color1)
- mon.setBackgroundColor(color2)
- for i=x,x+xsize-1 do
- for j=y,y+ysize-1 do
- screen[i][j] = funcCall
- mon.setCursorPos(i,j)
- mon.write(" ")
- end
- end
- mon.setCursorPos(xtext,ytext)
- mon.write(text)
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- end
- return DisplayLib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement