767 posts
Posted 16 April 2013 - 05:54 AM
Hello Everyone!
I am working on an OS, and im trying to make a button API. but…
kinda "button:51: Expected number, number" isnt the best result for me..
(
Pastebin)
I hope to see someone to help me!
Thanks in advance.
2088 posts
Location
South Africa
Posted 16 April 2013 - 05:57 AM
EDIT: Nevermind, big derp
How are you calling the function draw()
767 posts
Posted 16 April 2013 - 06:22 AM
with button.draw(buttonID ( which in this case is 1) )
im calling install with:
button.install(1,3,2,4,colors.red,colors.white,"Hello","testFunction",2) -- last variable is buttonID
and then drawing with
button.draw(2)
2088 posts
Location
South Africa
Posted 16 April 2013 - 06:28 AM
setPos(buttons[buttonID][xMin], buttons[buttonID][yMin])
All the lines with [xMin] [yMin] [tCol] [bCol] are giving the problems.
It's thinking you're trying to access a variable xMin and not the xMin value of the table.
Change it all to .xMin .yMin .tCol .bCol
setPos(buttons[buttonID].xMin, buttons[buttonID].yMin)
etc
EDIT: I remember someone saying this that you can't access number variables in a table like [xMin] etc, you need to use .xMin
If someone could confirm..
767 posts
Posted 16 April 2013 - 07:14 AM
EDIT:
Thanks.. it worked! now i'll continue my hard work…