NanoBob

NanoButton API -2 documentation

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