Advertisement
Guest User

Untitled

a guest
Jan 27th, 2018
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.02 KB | None | 0 0
  1.  
  2. local myButton = Button({
  3. x = 5000, // X coordinate
  4. y = 5000, // Y coordinate
  5. w = 1000, // Width
  6. y = 1000, // Texture
  7. texture = "LETTERS.TGA"});
  8.  
  9. void myButton.visible(bool);
  10. bool myButton.isVisible()
  11. void myButton.setTexture(string) // Set new texture
  12. void myButton.setPosition(int x, int y)
  13. void myButton.setSize(int w, int h)
  14. void myButton.setAlpha(int alpha)
  15. int myButton.getAlpha()
  16. table myButton.getParams()
  17.  
  18. //
  19.  
  20. This function returns table with button params in original format (when you create it). Like
  21.  
  22. local p = myButton.getParams();
  23. p.x - X coordinate
  24. p.y - Y coordinate
  25. p.w - width etc.
  26.  
  27. //
  28.  
  29. void myButton.access(bool) // Allows player click on it
  30. bool myButton.getAccess()
  31. void myButton.top() // Sets button to front of the screen
  32. bool myButton.getActive() // Returns true/false depends on player's cursor position
  33. void myButton.connect(Window) // Connect button to the window (it will be move with it)
  34. void myButton.disconnect()
  35.  
  36. local myWindow = Window({
  37. x = 5000, // X coordinate
  38. y = 5000, // Y coordinate
  39. w = 1000, // Width
  40. y = 1000, // Texture
  41. texture = "MENU_INGAME.TGA"});
  42.  
  43. All functions same as for buttons, but there 2 more
  44.  
  45. void myWindow.setMoving(bool) // Allows move window with cursor
  46. bool myWindow.getMoving()
  47.  
  48. local myText = Text({
  49. text = "Hello",
  50. x = 6000, // X coordinate
  51. y = 6000, // Y coordinate
  52. r = 255, // Color
  53. g = 255,
  54. b = 255,
  55. font = "Font_Old_10_White_hi.TGA"});
  56.  
  57. // This text splits to multi-string text with "&" symbol. For example
  58.  
  59. text = "Hello!& My name is Osmith"
  60.  
  61. will be shown
  62.  
  63. Hello!
  64. My name is Osmith
  65.  
  66. //
  67.  
  68. void myText.visible(bool)
  69. bool myText.isVisible()
  70. void myText.setText(string)
  71. void myText.setLineText(int line, string text) // Lines counting starts from 0
  72. void myText.setFont(string)
  73. void myText.setLineFont(int line, string font)
  74. void myText.setColor(int r, int g, int b)
  75. void myText.setLineColor(int line, int r, int g, int b)
  76. void myText.setPosition(int x, int y)
  77. void myText.setAlpha(int alpha)
  78. table myText.getParams() // Works same as with buttons/windows
  79. void myText.setAccess(bool)
  80. bool myText.getAccess()
  81. bool myText.getActive() // Returns true/false depending on if cursor on ANY line of the text
  82. bool myText.getLineActive(int line) // Returns true/false depending on if cursor on THIS line of the text
  83. int myText.active() // Returns active line (same as getActive() and getLineActive())
  84. void myText.top()
  85. void myText.connect(Window)
  86. void myText.disconnect()
  87.  
  88.  
  89. local myInput = Input({
  90. input = {x = 3797, y = 3688, r = 255, g = 255, b = 255, text = ""},
  91. note = {r = 255, g = 255, b = 255, text = ""},
  92. background = {x = 3737, y = 3602, w = 1486, h = 339, texture = "LOG_PAPER.TGA"},
  93. pass = false,
  94. len = 16,
  95. maxLen = 30});
  96.  
  97. //
  98.  
  99. Input - main input field
  100. Note - text shows when input field is empty
  101. Background - thats clear
  102. pass - password mode, when text hides with # symbols
  103. len - VISIBLE length of the text. When its reached, text will be scrolled
  104. maxLen - MAX length of the text. Whe its reached, you cant input any symbol more
  105.  
  106. //
  107.  
  108. void myInput.visible(bool)
  109. bool myInput.isVisible()
  110. void myInput.open()
  111. void myInput.close()
  112. bool myInput.getOpen()
  113. void myInput.setPass(bool) // Set password mode
  114. string myInput.get() // Returns text from the field
  115. void myInput.setText(string)
  116. void myInput.setColor(int r, int g, int b)
  117. void myInput.setNoteText(string)
  118. void myInput.setNoteColor(int r, int g, int b)
  119. void myInput.setPosition(int x, int y, int bX, int bY)
  120.  
  121. //
  122.  
  123. x,y - position of the input field
  124. bX,bY - position of the background
  125.  
  126. //
  127.  
  128. void myInput.setSize(w,h) // For background
  129. table myInput.getParams()
  130.  
  131. // Works same. So if you want get position, you need
  132.  
  133. local p = myInput.getParams();
  134. local posX = p.input.x;
  135. local posY = p.input.y;
  136.  
  137. etc.
  138.  
  139. local passMode = p.pass;
  140. local noteText = p.inputNote.text;
  141.  
  142. //
  143.  
  144. void myInput.access(bool)
  145. bool myInput.getAccess()
  146. void myInput.connect(Window)
  147. void myInput.disconnect()
  148. void myInput.top()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement