Posted 24 May 2015 - 03:05 AM
So, I'm trying to make it autocreate buttons. Basically, you tell it where, what colors, and what to say, and it will fill in the rest. Here's the code.
For some reason or another, the first one it makes works fine, the second one is wrong, and the third is even more wrong. Screenie:
The first one works just fine. The second doesn't draw the box right, and the third no box at all. Can someone tell me why this happens?
Thank you!
local function button(text,x,y,bgcolor,textcolor)
paintutils.drawFilledBox(x,y,#text+4,y+2,bgcolor)
s.bg(bgcolor)
term.setCursorPos(x+1,y+1)
s.text(textcolor)
write(text)
end
For some reason or another, the first one it makes works fine, the second one is wrong, and the third is even more wrong. Screenie:
Spoiler
The first one works just fine. The second doesn't draw the box right, and the third no box at all. Can someone tell me why this happens?
Thank you!