Advertisement
Derek1017

Test Button

Jul 13th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. local tCoords = {
  2.   [1] = {1, 2, 3, 4, "Login", func = login}, -- hooks up "login" function to this button
  3.   [2] = {10, 20 , 30 , 40, "Create Account", func = setup}, -- hooks up "setup" function to this button
  4. }
  5.  
  6. for i = 1, #tCoords do
  7.   if x >= tCoords[i][1] and x <= tCoords[i][2] and y >= tCoords[i][3] and y <= tCoords[i][4] then
  8.                 tCoords[i].func() -- executes the function hooked to the button
  9.                 break
  10.   end
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement