Advertisement
RaZgRiZ

NNUI Documentation 30/1/2014

Aug 12th, 2013
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.83 KB | None | 0 0
  1. // DO NOT TOUCH:
  2.     uiscrollsteptime
  3.     uislidersteptime
  4.     uisensitivity
  5.     uitextrows
  6.     uislotviewtime
  7. // ^^^^^^^^^^^^^
  8.  
  9. // NOTES:
  10. // Y stands for relative height
  11. // X stands for relative width
  12. // E stands for relative padding
  13. // S stands for relative character size
  14. // their scale is 1 = 1024px for ui children sizes, for anything else 1 is default size
  15. // any letters not described here are explained in the individual comments
  16.  
  17. // create a new UI, self explanatory
  18.     newui "STRING" [ children ] [ on-show ] [ on-hide ] 0/1(ALLOW INPUT)
  19. // other self explanatory commands
  20.     showui   "STRING" // show the ui, duh
  21.     hideui   "STRING" // now hide it, why do i have to explain?
  22.     toggleui "STRING" // if open, hide it and vice-verca
  23.     holdui   "STRING" // will stay open as long as key is held
  24.  
  25. // draws a simple colored line
  26.     uiline 0xAARRGGBB [ children ]
  27. // draws a colored outline with dimensions X and Y
  28.     uioutline 0xAARRGGBB X Y [ children ]
  29. // draws a colored rectangle with dimensions X and Y
  30.     uicolor 0xAARRGGBB X Y [ children ]
  31.     uimodcolor 0xAARRGGBB X Y [ children ] // modulated
  32. // draws a gradient colored rectangle with dimensions X and Y
  33.     uihgradient 0xAARRGGBB 0xAARRGGBB X Y [ children ] // horizontal
  34.     uivgradient 0xAARRGGBB 0xAARRGGBB X Y [ children ] // vertical
  35.     uimodhgradient 0xAARRGGBB 0xAARRGGBB X Y [ children ] // horizontal, modulated
  36.     uimodvgradient 0xAARRGGBB 0xAARRGGBB X Y [ children ] // vertical, modulated
  37.  
  38. // changes the orientation of UI children within, applying padding of size E between them
  39.     uihlist E [ children ] // horizontal
  40.     uivlist E [ children ] // vertical
  41.     uilist  E [ children ] // alternates between h/v according to parent
  42.  
  43. // defines an area as a table and applies X and Y padding between its children
  44.     uitable X Y [ children ]
  45. // defines an area as a table row, where the column children are treated as items of the table
  46. // and the background children span the entire row. the headers cannot be targeted by ui states
  47. // and the rows cannot be inside any other ui elements besides their table.
  48.     uitableheader [ column children ] [ background children ]
  49.     uitablerow    [ column children ] [ background children ]
  50.  
  51. // formats all direct children into a grid, with C amount of columns and X and Y padding applied between them
  52.     uigrid C X Y [ children ]
  53. // defines a space where all direct children are grouped on the same spot
  54.     uigroup [ children ]
  55.  
  56. // creates a space with dimensions X and Y around its UI children
  57.     uispace  X Y [ children ]
  58. // creates a space with dimensions X and Y where it places its UI children
  59.     uifill   X Y [ children ]
  60. // same as uifill, except it can be targeted by color and input
  61.     uitarget X Y [ children ]
  62. // defines a space with dimensions X and Y where everything inside will be clipped off it exceeds the boundaries
  63.     uiclip   X Y [ children ]
  64. // offsets its children by size X and Y from their center (groups them if more than one)
  65.     uioffset X Y [ children ]
  66.  
  67. // creates a text editor with the name #1, with character amount L and R rows, text size S
  68. // and initialisation text #2, WARNING: UNKNOWN ARGUMENT DETECTED! EXTERMINATE!
  69.     uitexteditor "STRING #1" L R S "STRING #2" ? [ children ]
  70.  
  71. // creates text string with size S (default 1)
  72.     uitext "STRING" S [ children ]
  73.     uicolortext "STRING" 0xAARRGGBB S [ children ] // allows color
  74. // creates text string with size S which wraps if length beyond size X
  75.     uiwraptext "STRING" X S [ children ]
  76.     uiwrapcolortext "STRING" X 0xAARRGGBB S [ children ] // allows color
  77.  
  78. // creates a (key)field with name VAR, string length L and character size S
  79.     uifield "VAR" L [ on-change ] S [ children ]
  80.     uikeyfield "VAR" L [ on-change ] S [ children ]
  81.  
  82. // creates a rectangle of dimensions X and Y with the texture matching index I
  83.     uislotview  I X Y [ children ]
  84.     uivslotview I X Y [ children ]
  85.  
  86. // creates a rectangle of dimensions X and Y with an image inside
  87.     uiimage "path/goes/here.png" X Y [ children ]
  88. // creates a rectangle of dimensions X and Y with an image that stretches to fit the size of
  89. // children, stretching the image at the middle in a cross-like fashion to fit.
  90.     uistretchedimage "path/goes/here.png" X Y [ children ]
  91. // creates a rectangle of dimensions X and Y with an image tiled along the surface, sized W and H
  92.     uitiledimage "path/goes/here.png" W H X Y [ children ]
  93. // creates a rectangle of dimensions X and Y with an image portion cropped between the points C* (0.0 to 1.0)
  94.     uicroppedimage "path/goes/here.png" X Y Cx-start Cy-start Cx-end Cy-end [ children ]
  95. // creates a rectangle of sorts and does stuff. this thing sucks, don't use it.
  96. // T is texture size, B is for extension size around children (shit's broken yo)
  97.     uiborderedimage "path/goes/here.png" T B [ children ]
  98.  
  99. // creates a rectangle of dimensions X and Y which shows a preview of the model at given path and animation
  100.     uimodelpreview "path/goes/here" "animation" X Y [ children ]
  101. // creates a rectangle of dimensions X and Y which shows a preview of a playermodel, in team
  102. // color and weapon given the three indexes respectively for model, team and weapon (Im, It, Iw).
  103.     uiplayerpreview Im It Iw X Y [ children ]
  104.  
  105. // clamping attempts to "stretch" a child/parent within its available space through its four arguments
  106. // in the case of lists, clamping will ignore list children padding, so use carefully
  107.     uiclamp  L R T B // clamps the parent
  108.     uiclamp- L R T B // clamps the previous child
  109.     uiclamp* L R T B // clamps all previous children
  110.  
  111. // -2 : do not attempt to align (use instead of 0 if you DON'T NEED to align something to the center)
  112. // -1 : left justified/top,
  113. //  0 : center
  114. //  1 : right justified/bottom
  115.     uialign  X-align Y-align // aligns the parent
  116.     uialign- X-align Y-align // aligns the previous child
  117.     uialign* X-align Y-align // aligns all previous children
  118.  
  119. // creates a rectangle with dimensions X and Y where its UI children are affected by scrollbars
  120.     uiscroll X Y [ children ]
  121. // creates a scroll arrow with value step V, must be outside ui(h/v)scrollbar
  122.     uiscrollarrow V [ children ]
  123. // creates a scroll button, must be inside ui(h/v)scrollbar
  124.     uiscrollbutton [ children ]
  125. // creates a rectangle which acts as the scroll bar, the scroll button must be inside
  126.     ui(h/v)scrollbar [ children ]
  127.  
  128. // creates a slider with size X, MIN and MAX, which modifies VAR in V steps.
  129.     ui(h/v)slider "VAR" MIN MAX V X [ on-change ] [ children ]
  130. // creates a slider arrow with value step V, must be outside ui(h/v)slider
  131.     uisliderarrow V [ children ]
  132. // creates a slider button, must be inside ui(h/v)slider
  133.     uisliderbutton [ children ]
  134.  
  135. // creates a UI state check which executes/results a true or false condition, see the legend below
  136.     ui(!)[PREFIX|STATE](+)(?) T F
  137. // SYMBOL    NONE    : checks parent for given STATE
  138. //              !    : checks parent for given STATE and if non of the children in it share it
  139. //              +    : checks the next ui children to be created for given STATE
  140. //              ?    : makes the STATE check behave like '?' and results its T/F conditions instead.
  141. // ------------------------------
  142. // ONLY APPLICABLE TO STATES: press, hold, release
  143. // PREFIX    NONE    : left mouse click check (default)
  144. //            alt    : middle mouse check
  145. //            esc    : right mouse click
  146. // ------------------------------
  147. // STATE     press        : executes when button is pressed
  148. //           hold         : executes when button is held
  149. //           release      : executes when button is released
  150. //           hover        : executes when cursor hovers over
  151. //           focus        : executes when a child has input focus
  152. //           scrolldown   : executes when scrolling down
  153. //           scrollup     : executes when scrolling up
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement