Advertisement
NanoBob

NanoButton API -2 documentation

Dec 21st, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. setMonitorSide(side)
  2. Sets the side the monitor is on. This is required before calling any of the other functions
  3. Required arguments:
  4. Side Side the monitor is on. (string)
  5. Optional arguments:
  6. N/A
  7. Returns
  8. N/A
  9.  
  10. addButton(x,y,width,height,text,function,toggle,relative,idleColor,activeColor,textColor)
  11. This functions adds a button to the monitor
  12. Required arguments:
  13. X The x position of the left top corner of the button. (float)
  14. Y The y position of the left top corner of the button. (float)
  15. Width The width of the button. (float)
  16. Height The height of the button. (float)
  17. Text The text you want to be displayed on the button. (string)
  18. Function The function you want to call when the button is clicked. (function)
  19. Optional arguments:
  20. Toggle If this is set to true the button will be toggled when clicked (Boolean)
  21. Relative If this is set to true the x,y,width and height variable will be made relative to the screen size. Meaning an x of 0.2 would set the button at 0.2 of the entire screen width. (Boolean)
  22. IdleColor The color of the button when not activated. (color) (Will use default when not specified)
  23. ActiveColor The color of the button when activated. (color) (Will use default when not specified)
  24. TextColor The color of the text on the button. (color) (Will use default when not specified)
  25.  
  26. Returns
  27. The function returns a button id (float)
  28. The function returns false when not all arguments were specified, or no monitor was assigned. 
  29. removeButton(buttonID)
  30. This function removes a button from the monitor
  31. Required arguments:
  32. buttonID The ID of the button (float)
  33. Optional arguments:
  34. N/A
  35. Returns
  36. Returns true when successfully removed.
  37. Returns false when not successfully removed.
  38. getButtonInfo(buttonID)
  39. Required arguments:
  40. buttonID The ID of the button (float)
  41. Optional arguments:
  42. N/A
  43. Returns
  44. Returns a table of all information about that button. Prints this when in debug mode.
  45. Returns false when not successful.
  46. setButtonInfo(buttonID,infoID,info)
  47. This function sets info on buttons, what info there is available can be found by using getButtonInfo()
  48. Required arguments:
  49. buttonID The ID of the button (float)
  50. infoID The key that the info is saved on. (string)
  51. info The info to be set to (any)
  52. Optional arguments:
  53. N/A
  54. Returns
  55. Returns true when sucessful
  56. Returns false when not successful  
  57. run ()
  58. This function checks for clicks on the screen, and runs the function respectable to that button.
  59. Required arguments:
  60. N/A
  61. Optional arguments:
  62. N/A
  63. Returns
  64. N/A
  65.  
  66.  
  67.  
  68.  
  69. setDebugMode(bool)
  70. Sets whether debug mode is activated, if it is activated it will print errors.
  71. Required arguments:
  72. Bool true to activate debug mode, false to deactivate. (Boolean)
  73. Optional arguments:
  74. Returns
  75. setIdleColor (color)
  76. Required arguments:
  77. Color color for the idle background of the button (color)
  78. Optional arguments:
  79. N/A
  80. Returns
  81. N/A
  82.  
  83. setActiveColor(color)
  84. Required arguments:
  85. Color color for the active background of the button (color)
  86. Optional arguments:
  87. N/A
  88. Returns
  89. N/A
  90.  
  91. setBackgroundColor(color)
  92. Required arguments:
  93. Color color for the idle background of the monitor (color)
  94. Optional arguments:
  95. N/A
  96. Returns
  97. N/A
  98.  
  99. setTextColor(color)
  100. Required arguments:
  101. Color color for the text of the button (color)
  102. Optional arguments:
  103. N/A
  104. Returns
  105. N/A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement