node.html 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <!-- This file is generated by Nim. -->
  5. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <!-- Favicon -->
  10. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  11. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  12. <!-- Google fonts -->
  13. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  14. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  15. <!-- CSS -->
  16. <title>nodesnim/nodes/node</title>
  17. <link rel="stylesheet" type="text/css" href="../../nimdoc.out.css">
  18. <script type="text/javascript" src="dochack.js"></script>
  19. <script type="text/javascript">
  20. function main() {
  21. var pragmaDots = document.getElementsByClassName("pragmadots");
  22. for (var i = 0; i < pragmaDots.length; i++) {
  23. pragmaDots[i].onclick = function(event) {
  24. // Hide tease
  25. event.target.parentNode.style.display = "none";
  26. // Show actual
  27. event.target.parentNode.nextElementSibling.style.display = "inline";
  28. }
  29. }
  30. const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
  31. function switchTheme(e) {
  32. if (e.target.checked) {
  33. document.documentElement.setAttribute('data-theme', 'dark');
  34. localStorage.setItem('theme', 'dark');
  35. } else {
  36. document.documentElement.setAttribute('data-theme', 'light');
  37. localStorage.setItem('theme', 'light');
  38. }
  39. }
  40. toggleSwitch.addEventListener('change', switchTheme, false);
  41. if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
  42. document.documentElement.setAttribute('data-theme', "dark");
  43. toggleSwitch.checked = true;
  44. } else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
  45. document.documentElement.setAttribute('data-theme', "light");
  46. toggleSwitch.checked = false;
  47. } else {
  48. const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
  49. if (currentTheme) {
  50. document.documentElement.setAttribute('data-theme', currentTheme);
  51. if (currentTheme === 'dark') {
  52. toggleSwitch.checked = true;
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. </head>
  59. <body onload="main()">
  60. <div class="document" id="documentId">
  61. <div class="container">
  62. <h1 class="title">nodesnim/nodes/node</h1>
  63. <div class="row">
  64. <div class="three columns">
  65. <div class="theme-switch-wrapper">
  66. <label class="theme-switch" for="checkbox">
  67. <input type="checkbox" id="checkbox" />
  68. <div class="slider round"></div>
  69. </label>
  70. &nbsp;&nbsp;&nbsp; <em>Dark Mode</em>
  71. </div>
  72. <div id="global-links">
  73. <ul class="simple">
  74. </ul>
  75. </div>
  76. <div id="searchInputDiv">
  77. Search: <input type="text" id="searchInput"
  78. onkeyup="search()" />
  79. </div>
  80. <div>
  81. Group by:
  82. <select onchange="groupBy(this.value)">
  83. <option value="section">Section</option>
  84. <option value="type">Type</option>
  85. </select>
  86. </div>
  87. <ul class="simple simple-toc" id="toc-list">
  88. <ul class="simple"><li><a class="reference" id="examples_toc" href="#examples">Examples</a></li>
  89. </ul><li>
  90. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  91. <ul class="simple simple-toc-section">
  92. </ul>
  93. </li>
  94. <li>
  95. <a class="reference reference-toplevel" href="#7" id="57">Types</a>
  96. <ul class="simple simple-toc-section">
  97. <li><a class="reference" href="#NodeHandler"
  98. title="NodeHandler = proc (self: NodeRef)"><wbr />Node<wbr />Handler<span class="attachedType"></span></a></li>
  99. <li><a class="reference" href="#NodeEvHandler"
  100. title="NodeEvHandler = proc (self: NodeRef; event: InputEvent)"><wbr />Node<wbr />Ev<wbr />Handler<span class="attachedType"></span></a></li>
  101. <li><a class="reference" href="#NodeObj"
  102. title="NodeObj = object of RootObj
  103. kind*: NodeKind
  104. type_of_node*: NodeTypes ## default, gui, 2d or 3d.
  105. visibility*: Visibility ## visible, invisible or gone.
  106. is_ready*: bool ## true, when scene is ready.
  107. pausemode*: PauseMode ## Pause mode, by default is INHERIT.
  108. name*: string ## Node name.
  109. parent*: NodeRef ## Node parent.
  110. children*: seq[NodeRef] ## Node children.
  111. on_enter*: NodeHandler ## This called when scene changed.
  112. on_exit*: NodeHandler ## This called when exit from the scene.
  113. on_input*: NodeEvHandler ## This called on user input.
  114. on_ready*: NodeHandler ## This called when the scene changed and the `enter` was called.
  115. on_process*: NodeHandler ## This called every frame."><wbr />Node<wbr />Obj<span class="attachedType"></span></a></li>
  116. <li><a class="reference" href="#NodeRef"
  117. title="NodeRef = ref NodeObj"><wbr />Node<wbr />Ref<span class="attachedType"></span></a></li>
  118. </ul>
  119. </li>
  120. <li>
  121. <a class="reference reference-toplevel" href="#9" id="59">Lets</a>
  122. <ul class="simple simple-toc-section">
  123. <li><a class="reference" href="#handler_default"
  124. title="handler_default = proc (self: NodeRef) = discard"><wbr />handler_<wbr />default<span class="attachedType"></span></a></li>
  125. <li><a class="reference" href="#event_handler_default"
  126. title="event_handler_default = proc (self: NodeRef; event: InputEvent) = discard"><wbr />event_<wbr />handler_<wbr />default<span class="attachedType"></span></a></li>
  127. </ul>
  128. </li>
  129. <li>
  130. <a class="reference reference-toplevel" href="#12" id="62">Procs</a>
  131. <ul class="simple simple-toc-section">
  132. <li><a class="reference" href="#Node%2Cstring"
  133. title="Node(name: string = &quot;Node&quot;): NodeRef"><wbr />Node<span class="attachedType">NodeRef</span></a></li>
  134. </ul>
  135. </li>
  136. <li>
  137. <a class="reference reference-toplevel" href="#14" id="64">Methods</a>
  138. <ul class="simple simple-toc-section">
  139. <li><a class="reference" href="#addChild.e%2CNodeRef%2CNodeRef"
  140. title="addChild(self: NodeRef; child: NodeRef)"><wbr />add<wbr />Child<span class="attachedType">NodeRef</span></a></li>
  141. <li><a class="reference" href="#addChildren.e%2CNodeRef%2Cvarargs%5BNodeRef%5D"
  142. title="addChildren(self: NodeRef; childs: varargs[NodeRef])"><wbr />add<wbr />Children<span class="attachedType">NodeRef</span></a></li>
  143. <li><a class="reference" href="#draw.e%2CNodeRef%2CGLfloat%2CGLfloat"
  144. title="draw(self: NodeRef; w, h: GLfloat)"><wbr />draw<span class="attachedType">NodeRef</span></a></li>
  145. <li><a class="reference" href="#duplicate.e%2CNodeRef"
  146. title="duplicate(self: NodeRef): NodeRef"><wbr />duplicate<span class="attachedType">NodeRef</span></a></li>
  147. <li><a class="reference" href="#getChild.e%2CNodeRef%2Cint"
  148. title="getChild(self: NodeRef; index: int): NodeRef"><wbr />get<wbr />Child<span class="attachedType">NodeRef</span></a></li>
  149. <li><a class="reference" href="#getChildCount.e%2CNodeRef"
  150. title="getChildCount(self: NodeRef): int"><wbr />get<wbr />Child<wbr />Count<span class="attachedType">NodeRef</span></a></li>
  151. <li><a class="reference" href="#getChildIndex.e%2CNodeRef%2Cstring"
  152. title="getChildIndex(self: NodeRef; name: string): int"><wbr />get<wbr />Child<wbr />Index<span class="attachedType">NodeRef</span></a></li>
  153. <li><a class="reference" href="#getChildIndex.e%2CNodeRef%2CNodeRef"
  154. title="getChildIndex(self: NodeRef; child: NodeRef): int"><wbr />get<wbr />Child<wbr />Index<span class="attachedType">NodeRef</span></a></li>
  155. <li><a class="reference" href="#getChildIter.e%2CNodeRef"
  156. title="getChildIter(self: NodeRef): seq[NodeRef]"><wbr />get<wbr />Child<wbr />Iter<span class="attachedType">NodeRef</span></a></li>
  157. <li><a class="reference" href="#getNode.e%2CNodeRef%2Cstring"
  158. title="getNode(self: NodeRef; path: string): NodeRef"><wbr />get<wbr />Node<span class="attachedType">NodeRef</span></a></li>
  159. <li><a class="reference" href="#getPath.e%2CNodeRef"
  160. title="getPath(self: NodeRef): string"><wbr />get<wbr />Path<span class="attachedType">NodeRef</span></a></li>
  161. <li><a class="reference" href="#getParent.e%2CNodeRef"
  162. title="getParent(self: NodeRef): NodeRef"><wbr />get<wbr />Parent<span class="attachedType">NodeRef</span></a></li>
  163. <li><a class="reference" href="#getPauseMode.e%2CNodeRef"
  164. title="getPauseMode(self: NodeRef): PauseMode"><wbr />get<wbr />Pause<wbr />Mode<span class="attachedType">NodeRef</span></a></li>
  165. <li><a class="reference" href="#getRootNode.e%2CNodeRef"
  166. title="getRootNode(self: NodeRef): NodeRef"><wbr />get<wbr />Root<wbr />Node<span class="attachedType">NodeRef</span></a></li>
  167. <li><a class="reference" href="#isParentOf.e%2CNodeRef%2CNodeRef"
  168. title="isParentOf(self, other: NodeRef): bool"><wbr />is<wbr />Parent<wbr />Of<span class="attachedType">NodeRef</span></a></li>
  169. <li><a class="reference" href="#handle.e%2CNodeRef%2CInputEvent%2CNodeRef"
  170. title="handle(self: NodeRef; event: InputEvent; mouse_on: var NodeRef)"><wbr />handle<span class="attachedType">NodeRef</span></a></li>
  171. <li><a class="reference" href="#hasNode.e%2CNodeRef%2Cstring"
  172. title="hasNode(self: NodeRef; name: string): bool"><wbr />has<wbr />Node<span class="attachedType">NodeRef</span></a></li>
  173. <li><a class="reference" href="#hasNode.e%2CNodeRef%2CNodeRef"
  174. title="hasNode(self: NodeRef; other: NodeRef): bool"><wbr />has<wbr />Node<span class="attachedType">NodeRef</span></a></li>
  175. <li><a class="reference" href="#hasParent.e%2CNodeRef"
  176. title="hasParent(self: NodeRef): bool"><wbr />has<wbr />Parent<span class="attachedType">NodeRef</span></a></li>
  177. <li><a class="reference" href="#hide.e%2CNodeRef"
  178. title="hide(self: NodeRef)"><wbr />hide<span class="attachedType">NodeRef</span></a></li>
  179. <li><a class="reference" href="#postdraw.e%2CNodeRef%2CGLfloat%2CGLfloat"
  180. title="postdraw(self: NodeRef; w, h: GLfloat)"><wbr />postdraw<span class="attachedType">NodeRef</span></a></li>
  181. <li><a class="reference" href="#rename.e%2CNodeRef%2Cstring"
  182. title="rename(self: NodeRef; new_name: string)"><wbr />rename<span class="attachedType">NodeRef</span></a></li>
  183. <li><a class="reference" href="#removeChild.e%2CNodeRef%2Cint"
  184. title="removeChild(self: NodeRef; index: int)"><wbr />remove<wbr />Child<span class="attachedType">NodeRef</span></a></li>
  185. <li><a class="reference" href="#removeChild.e%2CNodeRef%2CNodeRef"
  186. title="removeChild(self: NodeRef; other: NodeRef)"><wbr />remove<wbr />Child<span class="attachedType">NodeRef</span></a></li>
  187. <li><a class="reference" href="#show.e%2CNodeRef"
  188. title="show(self: NodeRef)"><wbr />show<span class="attachedType">NodeRef</span></a></li>
  189. <li><a class="reference" href="#delete.e%2CNodeRef"
  190. title="delete(self: NodeRef)"><wbr />delete<span class="attachedType">NodeRef</span></a></li>
  191. <li><a class="reference" href="#%5B%5D.e%2CNodeRef%2Cint"
  192. title="`[]`(self: NodeRef; index: int): NodeRef"><wbr />`[]`<span class="attachedType">NodeRef</span></a></li>
  193. <li><a class="reference" href="#~.e%2CNodeRef%2Cstring"
  194. title="`~`(self: NodeRef; path: string): NodeRef"><wbr />`~`<span class="attachedType">NodeRef</span></a></li>
  195. </ul>
  196. </li>
  197. <li>
  198. <a class="reference reference-toplevel" href="#17" id="67">Macros</a>
  199. <ul class="simple simple-toc-section">
  200. <li><a class="reference" href="#%40.m%2CNodeRef%2Cuntyped%2Cuntyped"
  201. title="`@`(node: NodeRef; event_name, code: untyped): untyped"><wbr />`@`<span class="attachedType">NodeRef</span></a></li>
  202. </ul>
  203. </li>
  204. <li>
  205. <a class="reference reference-toplevel" href="#18" id="68">Templates</a>
  206. <ul class="simple simple-toc-section">
  207. <li><a class="reference" href="#nodepattern.t%2Cuntyped"
  208. title="nodepattern(nodetype: untyped): untyped"><wbr />nodepattern<span class="attachedType"></span></a></li>
  209. </ul>
  210. </li>
  211. </ul>
  212. </div>
  213. <div class="nine columns" id="content">
  214. <div id="tocRoot"></div>
  215. <p class="module-desc">Node is the root type of all other nodes.</p>
  216. <div class="section" id="6">
  217. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  218. <dl class="item">
  219. <a class="reference external" href="../thirdparty/opengl.html">../thirdparty/opengl</a>, <a class="reference external" href="../core/vector2.html">../core/vector2</a>, <a class="reference external" href="../core/enums.html">../core/enums</a>, <a class="reference external" href="../core/anchor.html">../core/anchor</a>, <a class="reference external" href="../core/input.html">../core/input</a>
  220. </dl></div>
  221. <div class="section" id="7">
  222. <h1><a class="toc-backref" href="#7">Types</a></h1>
  223. <dl class="item">
  224. <a id="NodeHandler"></a>
  225. <dt><pre><a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span></pre></dt>
  226. <dd>
  227. </dd>
  228. <a id="NodeEvHandler"></a>
  229. <dt><pre><a href="node.html#NodeEvHandler"><span class="Identifier">NodeEvHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">)</span></pre></dt>
  230. <dd>
  231. </dd>
  232. <a id="NodeObj"></a>
  233. <dt><pre><a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">RootObj</span>
  234. <span class="Identifier">kind</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#NodeKind"><span class="Identifier">NodeKind</span></a>
  235. <span class="Identifier">type_of_node</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#NodeTypes"><span class="Identifier">NodeTypes</span></a> <span class="Comment">## default, gui, 2d or 3d.</span>
  236. <span class="Identifier">visibility</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#Visibility"><span class="Identifier">Visibility</span></a> <span class="Comment">## visible, invisible or gone.</span>
  237. <span class="Identifier">is_ready</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Comment">## true, when scene is ready.</span>
  238. <span class="Identifier">pausemode</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#PauseMode"><span class="Identifier">PauseMode</span></a> <span class="Comment">## Pause mode, by default is INHERIT.</span>
  239. <span class="Identifier">name</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## Node name.</span>
  240. <span class="Identifier">parent</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span class="Comment">## Node parent.</span>
  241. <span class="Identifier">children</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">]</span> <span class="Comment">## Node children.</span>
  242. <span class="Identifier">on_enter</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called when scene changed.</span>
  243. <span class="Identifier">on_exit</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called when exit from the scene.</span>
  244. <span class="Identifier">on_input</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeEvHandler"><span class="Identifier">NodeEvHandler</span></a> <span class="Comment">## This called on user input.</span>
  245. <span class="Identifier">on_ready</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called when the scene changed and the `enter` was called.</span>
  246. <span class="Identifier">on_process</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called every frame.</span>
  247. </pre></dt>
  248. <dd>
  249. </dd>
  250. <a id="NodeRef"></a>
  251. <dt><pre><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a></pre></dt>
  252. <dd>
  253. </dd>
  254. </dl></div>
  255. <div class="section" id="9">
  256. <h1><a class="toc-backref" href="#9">Lets</a></h1>
  257. <dl class="item">
  258. <a id="handler_default"></a>
  259. <dt><pre><a href="node.html#handler_default"><span class="Identifier">handler_default</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">discard</span></pre></dt>
  260. <dd>
  261. </dd>
  262. <a id="event_handler_default"></a>
  263. <dt><pre><a href="node.html#event_handler_default"><span class="Identifier">event_handler_default</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">discard</span></pre></dt>
  264. <dd>
  265. </dd>
  266. </dl></div>
  267. <div class="section" id="12">
  268. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  269. <dl class="item">
  270. <a id="Node,string"></a>
  271. <dt><pre><span class="Keyword">proc</span> <a href="#Node%2Cstring"><span class="Identifier">Node</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other">=</span> <span class="StringLit">&quot;Node&quot;</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  272. <dd>
  273. Creates a new Node.
  274. </dd>
  275. </dl></div>
  276. <div class="section" id="14">
  277. <h1><a class="toc-backref" href="#14">Methods</a></h1>
  278. <dl class="item">
  279. <a id="addChild.e,NodeRef,NodeRef"></a>
  280. <dt><pre><span class="Keyword">method</span> <a href="#addChild.e%2CNodeRef%2CNodeRef"><span class="Identifier">addChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">child</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  281. <dd>
  282. <p>Adds new child in current node.</p>
  283. <p>Arguments:</p>
  284. <ul class="simple"><li><tt class="docutils literal"><span class="pre">child</span></tt>: other node.</li>
  285. </ul>
  286. <p>See also:</p>
  287. <ul class="simple"><li><a class="reference external" href="#addChildren.e,NodeRef,varargs[NodeRef]">addChildren method</a></li>
  288. <li><a class="reference external" href="#getChild.e,NodeRef,int">getChild method</a></li>
  289. </ul>
  290. </dd>
  291. <a id="addChildren.e,NodeRef,varargs[NodeRef]"></a>
  292. <dt><pre><span class="Keyword">method</span> <a href="#addChildren.e%2CNodeRef%2Cvarargs%5BNodeRef%5D"><span class="Identifier">addChildren</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">childs</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">]</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  293. <dd>
  294. <p>Adds new child in current node.</p>
  295. <p>Arguments:</p>
  296. <ul class="simple"><li><tt class="docutils literal"><span class="pre">child</span></tt>: other node.</li>
  297. </ul>
  298. <p>See also:</p>
  299. <ul class="simple"><li><a class="reference external" href="#addChild.e,NodeRef,NodeRef">addChild method</a></li>
  300. </ul>
  301. </dd>
  302. <a id="draw.e,NodeRef,GLfloat,GLfloat"></a>
  303. <dt><pre><span class="Keyword">method</span> <a href="#draw.e%2CNodeRef%2CGLfloat%2CGLfloat"><span class="Identifier">draw</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">w</span><span class="Other">,</span> <span class="Identifier">h</span><span class="Other">:</span> <a href="../thirdparty/opengl.html#GLfloat"><span class="Identifier">GLfloat</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  304. <dd>
  305. Draws node. This used in the Window object.
  306. </dd>
  307. <a id="duplicate.e,NodeRef"></a>
  308. <dt><pre><span class="Keyword">method</span> <a href="#duplicate.e%2CNodeRef"><span class="Identifier">duplicate</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  309. <dd>
  310. Duplicates Node object and create a new Node.
  311. </dd>
  312. <a id="getChild.e,NodeRef,int"></a>
  313. <dt><pre><span class="Keyword">method</span> <a href="#getChild.e%2CNodeRef%2Cint"><span class="Identifier">getChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">index</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  314. <dd>
  315. <p>Returns child at <tt class="docutils literal"><span class="pre">index</span></tt> position, if available.</p>
  316. <p>Arguments:</p>
  317. <ul class="simple"><li><tt class="docutils literal"><span class="pre">index</span></tt>: child index.</li>
  318. </ul>
  319. <p>See also:</p>
  320. <ul class="simple"><li><a class="reference external" href="#addChild.e,NodeRef,NodeRef">addChild method</a></li>
  321. <li><a class="reference external" href="#getChildCount.e,NodeRef">getChildCount method</a></li>
  322. </ul>
  323. </dd>
  324. <a id="getChildCount.e,NodeRef"></a>
  325. <dt><pre><span class="Keyword">method</span> <a href="#getChildCount.e%2CNodeRef"><span class="Identifier">getChildCount</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  326. <dd>
  327. <p>Returns child count.</p>
  328. <p>See also:</p>
  329. <ul class="simple"><li><a class="reference external" href="#getChild.e,NodeRef,int">getChild method</a></li>
  330. </ul>
  331. </dd>
  332. <a id="getChildIndex.e,NodeRef,string"></a>
  333. <dt><pre><span class="Keyword">method</span> <a href="#getChildIndex.e%2CNodeRef%2Cstring"><span class="Identifier">getChildIndex</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  334. <dd>
  335. <p>Returns <tt class="docutils literal"><span class="pre">child</span></tt> index or -1, if another node is not the child.</p>
  336. <p>See also:</p>
  337. <ul class="simple"><li><a class="reference external" href="#getChildIndex.e,NodeRef,NodeRef">getChildIndex method</a></li>
  338. </ul>
  339. </dd>
  340. <a id="getChildIndex.e,NodeRef,NodeRef"></a>
  341. <dt><pre><span class="Keyword">method</span> <a href="#getChildIndex.e%2CNodeRef%2CNodeRef"><span class="Identifier">getChildIndex</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">child</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  342. <dd>
  343. <p>Returns <tt class="docutils literal"><span class="pre">child</span></tt> index or -1, if another node is not the child.</p>
  344. <p>See also:</p>
  345. <ul class="simple"><li><a class="reference external" href="#getChildIndex.e,NodeRef,string">getChildIndex method</a></li>
  346. </ul>
  347. </dd>
  348. <a id="getChildIter.e,NodeRef"></a>
  349. <dt><pre><span class="Keyword">method</span> <a href="#getChildIter.e%2CNodeRef"><span class="Identifier">getChildIter</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
  350. <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  351. <dd>
  352. Returns all children iter.
  353. </dd>
  354. <a id="getNode.e,NodeRef,string"></a>
  355. <dt><pre><span class="Keyword">method</span> <a href="#getNode.e%2CNodeRef%2Cstring"><span class="Identifier">getNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">path</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  356. <dd>
  357. Returns child by <tt class="docutils literal"><span class="pre">path</span></tt>
  358. </dd>
  359. <a id="getPath.e,NodeRef"></a>
  360. <dt><pre><span class="Keyword">method</span> <a href="#getPath.e%2CNodeRef"><span class="Identifier">getPath</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  361. <dd>
  362. Returns node path.
  363. </dd>
  364. <a id="getParent.e,NodeRef"></a>
  365. <dt><pre><span class="Keyword">method</span> <a href="#getParent.e%2CNodeRef"><span class="Identifier">getParent</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  366. <dd>
  367. Returns node parent.
  368. </dd>
  369. <a id="getPauseMode.e,NodeRef"></a>
  370. <dt><pre><span class="Keyword">method</span> <a href="#getPauseMode.e%2CNodeRef"><span class="Identifier">getPauseMode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="../core/enums.html#PauseMode"><span class="Identifier">PauseMode</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  371. <dd>
  372. Calculates pause mode
  373. </dd>
  374. <a id="getRootNode.e,NodeRef"></a>
  375. <dt><pre><span class="Keyword">method</span> <a href="#getRootNode.e%2CNodeRef"><span class="Identifier">getRootNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  376. <dd>
  377. Gets root node.
  378. </dd>
  379. <a id="isParentOf.e,NodeRef,NodeRef"></a>
  380. <dt><pre><span class="Keyword">method</span> <a href="#isParentOf.e%2CNodeRef%2CNodeRef"><span class="Identifier">isParentOf</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">,</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  381. <dd>
  382. </dd>
  383. <a id="handle.e,NodeRef,InputEvent,NodeRef"></a>
  384. <dt><pre><span class="Keyword">method</span> <a href="#handle.e%2CNodeRef%2CInputEvent%2CNodeRef"><span class="Identifier">handle</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">;</span> <span class="Identifier">mouse_on</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span>
  385. <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  386. <dd>
  387. Handles user input. This used in the Window object.
  388. </dd>
  389. <a id="hasNode.e,NodeRef,string"></a>
  390. <dt><pre><span class="Keyword">method</span> <a href="#hasNode.e%2CNodeRef%2Cstring"><span class="Identifier">hasNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  391. <dd>
  392. <p>Returns true, if a node with name <tt class="docutils literal"><span class="pre">name</span></tt> in children.</p>
  393. <p>Arguments:</p>
  394. <ul class="simple"><li><tt class="docutils literal"><span class="pre">name</span></tt>: node name.</li>
  395. </ul>
  396. </dd>
  397. <a id="hasNode.e,NodeRef,NodeRef"></a>
  398. <dt><pre><span class="Keyword">method</span> <a href="#hasNode.e%2CNodeRef%2CNodeRef"><span class="Identifier">hasNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  399. <dd>
  400. <p>Returns true, if <tt class="docutils literal"><span class="pre">other</span></tt> in self children.</p>
  401. <p>Arguments:</p>
  402. <ul class="simple"><li><tt class="docutils literal"><span class="pre">other</span></tt>: other node.</li>
  403. </ul>
  404. </dd>
  405. <a id="hasParent.e,NodeRef"></a>
  406. <dt><pre><span class="Keyword">method</span> <a href="#hasParent.e%2CNodeRef"><span class="Identifier">hasParent</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  407. <dd>
  408. Returns true, when node has parent.
  409. </dd>
  410. <a id="hide.e,NodeRef"></a>
  411. <dt><pre><span class="Keyword">method</span> <a href="#hide.e%2CNodeRef"><span class="Identifier">hide</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  412. <dd>
  413. </dd>
  414. <a id="postdraw.e,NodeRef,GLfloat,GLfloat"></a>
  415. <dt><pre><span class="Keyword">method</span> <a href="#postdraw.e%2CNodeRef%2CGLfloat%2CGLfloat"><span class="Identifier">postdraw</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">w</span><span class="Other">,</span> <span class="Identifier">h</span><span class="Other">:</span> <a href="../thirdparty/opengl.html#GLfloat"><span class="Identifier">GLfloat</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  416. <dd>
  417. Draws node. This used in the Window object.
  418. </dd>
  419. <a id="rename.e,NodeRef,string"></a>
  420. <dt><pre><span class="Keyword">method</span> <a href="#rename.e%2CNodeRef%2Cstring"><span class="Identifier">rename</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">new_name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  421. <dd>
  422. </dd>
  423. <a id="removeChild.e,NodeRef,int"></a>
  424. <dt><pre><span class="Keyword">method</span> <a href="#removeChild.e%2CNodeRef%2Cint"><span class="Identifier">removeChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">index</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  425. <dd>
  426. <p>Removes node child at a specific position.</p>
  427. <p>Arguments:</p>
  428. <ul class="simple"><li><tt class="docutils literal"><span class="pre">index</span></tt>: child index.</li>
  429. </ul>
  430. <p>See also:</p>
  431. <ul class="simple"><li><a class="reference external" href="#addChild.e,NodeRef,NodeRef">addChild method</a></li>
  432. </ul>
  433. </dd>
  434. <a id="removeChild.e,NodeRef,NodeRef"></a>
  435. <dt><pre><span class="Keyword">method</span> <a href="#removeChild.e%2CNodeRef%2CNodeRef"><span class="Identifier">removeChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  436. <dd>
  437. <p>Removes another node from <tt class="docutils literal"><span class="pre">self</span></tt>, if <tt class="docutils literal"><span class="pre">other</span></tt> in <tt class="docutils literal"><span class="pre">self</span></tt> children.</p>
  438. <p>Arguments:</p>
  439. <ul class="simple"><li><tt class="docutils literal"><span class="pre">other</span></tt>: other node.</li>
  440. </ul>
  441. </dd>
  442. <a id="show.e,NodeRef"></a>
  443. <dt><pre><span class="Keyword">method</span> <a href="#show.e%2CNodeRef"><span class="Identifier">show</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  444. <dd>
  445. </dd>
  446. <a id="delete.e,NodeRef"></a>
  447. <dt><pre><span class="Keyword">method</span> <a href="#delete.e%2CNodeRef"><span class="Identifier">delete</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  448. <dd>
  449. Deletes current node.
  450. </dd>
  451. <a id="[].e,NodeRef,int"></a>
  452. <dt><pre><span class="Keyword">method</span> <a href="#%5B%5D.e%2CNodeRef%2Cint"><span class="Identifier">`[]`</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">index</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  453. <dd>
  454. </dd>
  455. <a id="~.e,NodeRef,string"></a>
  456. <dt><pre><span class="Keyword">method</span> <a href="#~.e%2CNodeRef%2Cstring"><span class="Identifier">`~`</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">path</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
  457. <dd>
  458. </dd>
  459. </dl></div>
  460. <div class="section" id="17">
  461. <h1><a class="toc-backref" href="#17">Macros</a></h1>
  462. <dl class="item">
  463. <a id="@.m,NodeRef,untyped,untyped"></a>
  464. <dt><pre><span class="Keyword">macro</span> <a href="#%40.m%2CNodeRef%2Cuntyped%2Cuntyped"><span class="Identifier">`@`</span></a><span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event_name</span><span class="Other">,</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
  465. <dd>
  466. <p>It provides a convenient wrapper for the event handler.</p>
  467. <p>Arguments:</p>
  468. <ul class="simple"><li><tt class="docutils literal"><span class="pre">node</span></tt> is an any node pointer.</li>
  469. <li><tt class="docutils literal"><span class="pre">event_name</span></tt> is an event name, e.g.: process.</li>
  470. <li><tt class="docutils literal"><span class="pre">code</span></tt> is the proc code.</li>
  471. </ul>
  472. <h2><a class="toc-backref" id="examples" href="#examples">Examples</a></h2><pre class="listing"><span class="Keyword">var</span>
  473. <span class="Identifier">smth_node</span> <span class="Operator">=</span> <span class="Identifier">Node</span><span class="Punctuation">(</span><span class="StringLit">&quot;Simple node&quot;</span><span class="Punctuation">)</span>
  474. <span class="Identifier">smth_node</span><span class="Operator">@</span><span class="Identifier">on_ready</span><span class="Punctuation">(</span><span class="Identifier">self</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
  475. <span class="Identifier">echo</span> <span class="StringLit">&quot;node is ready!&quot;</span>
  476. <span class="Identifier">smth_node</span><span class="Operator">@</span><span class="Identifier">on_input</span><span class="Punctuation">(</span><span class="Identifier">self</span><span class="Punctuation">,</span> <span class="Identifier">event</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
  477. <span class="Keyword">if</span> <span class="Identifier">event</span><span class="Operator">.</span><span class="Identifier">isInputEventMouseButton</span><span class="Punctuation">(</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
  478. <span class="Identifier">echo</span> <span class="Identifier">event</span></pre>
  479. </dd>
  480. </dl></div>
  481. <div class="section" id="18">
  482. <h1><a class="toc-backref" href="#18">Templates</a></h1>
  483. <dl class="item">
  484. <a id="nodepattern.t,untyped"></a>
  485. <dt><pre><span class="Keyword">template</span> <a href="#nodepattern.t%2Cuntyped"><span class="Identifier">nodepattern</span></a><span class="Other">(</span><span class="Identifier">nodetype</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
  486. <dd>
  487. This used in childs of the NodeObj.
  488. </dd>
  489. </dl></div>
  490. </div>
  491. </div>
  492. <div class="row">
  493. <div class="twelve-columns footer">
  494. <span class="nim-sprite"></span>
  495. <br/>
  496. <small style="color: var(--hint);">Made with Nim. Generated: 2021-11-03 16:19:04 UTC</small>
  497. </div>
  498. </div>
  499. </div>
  500. </div>
  501. </body>
  502. </html>