node.html 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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>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">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. <li>
  89. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  90. <ul class="simple simple-toc-section">
  91. </ul>
  92. </li>
  93. <li>
  94. <a class="reference reference-toplevel" href="#7" id="57">Types</a>
  95. <ul class="simple simple-toc-section">
  96. <li><a class="reference" href="#NodeObj"
  97. title="NodeObj = object of RootObj
  98. visible*: bool
  99. is_ready*: bool
  100. can_use_anchor*: bool
  101. can_use_size_anchor*: bool
  102. pausemode*: PauseMode ## Pause mode, by default is INHERIT.
  103. name*: string ## Node name.
  104. position*: Vector2Ref ## Node position, by default is Vector2(0, 0).
  105. global_position*: Vector2Ref ## Node global position.
  106. rect_size*: Vector2Ref ## Node size.
  107. size_anchor*: Vector2Ref ## Node size anchor.
  108. anchor*: AnchorRef ## Node anchor.
  109. parent*: NodePtr ## Node parent.
  110. children*: seq[NodePtr] ## Node children.
  111. enter*: proc () ## This called when scene changed.
  112. exit*: proc () ## This called when exit from the scene.
  113. input*: proc (event: InputEvent) ## This called on user input.
  114. ready*: proc () ## This called when the scene changed and the `enter` was called.
  115. process*: proc () ## This called every frame."><wbr />Node<wbr />Obj<span class="attachedType"></span></a></li>
  116. <li><a class="reference" href="#NodePtr"
  117. title="NodePtr = ptr NodeObj"><wbr />Node<wbr />Ptr<span class="attachedType"></span></a></li>
  118. </ul>
  119. </li>
  120. <li>
  121. <a class="reference reference-toplevel" href="#12" id="62">Procs</a>
  122. <ul class="simple simple-toc-section">
  123. <li><a class="reference" href="#Node%2Cstring%2CNodeObj"
  124. title="Node(name: string; variable: var NodeObj): NodePtr"><wbr />Node<span class="attachedType">NodePtr</span></a></li>
  125. <li><a class="reference" href="#Node%2CNodeObj"
  126. title="Node(variable: var NodeObj): NodePtr"><wbr />Node<span class="attachedType">NodeObj</span></a></li>
  127. </ul>
  128. </li>
  129. <li>
  130. <a class="reference reference-toplevel" href="#14" id="64">Methods</a>
  131. <ul class="simple simple-toc-section">
  132. <li><a class="reference" href="#addChild.e%2CNodePtr%2CNodePtr"
  133. title="addChild(self: NodePtr; child: NodePtr)"><wbr />add<wbr />Child<span class="attachedType">NodePtr</span></a></li>
  134. <li><a class="reference" href="#calcGlobalPosition.e%2CNodePtr"
  135. title="calcGlobalPosition(self: NodePtr)"><wbr />calc<wbr />Global<wbr />Position<span class="attachedType">NodePtr</span></a></li>
  136. <li><a class="reference" href="#calcPositionAnchor.e%2CNodePtr"
  137. title="calcPositionAnchor(self: NodePtr)"><wbr />calc<wbr />Position<wbr />Anchor<span class="attachedType">NodePtr</span></a></li>
  138. <li><a class="reference" href="#draw.e%2CNodePtr%2CGLfloat%2CGLfloat"
  139. title="draw(self: NodePtr; w, h: GLfloat)"><wbr />draw<span class="attachedType">NodePtr</span></a></li>
  140. <li><a class="reference" href="#draw2stage.e%2CNodePtr%2CGLfloat%2CGLfloat"
  141. title="draw2stage(self: NodePtr; w, h: GLfloat)"><wbr />draw2stage<span class="attachedType">NodePtr</span></a></li>
  142. <li><a class="reference" href="#duplicate.e%2CNodePtr%2CNodeObj"
  143. title="duplicate(self: NodePtr; obj: var NodeObj): NodePtr"><wbr />duplicate<span class="attachedType">NodePtr</span></a></li>
  144. <li><a class="reference" href="#getChild.e%2CNodePtr%2Cint"
  145. title="getChild(self: NodePtr; index: int): NodePtr"><wbr />get<wbr />Child<span class="attachedType">NodePtr</span></a></li>
  146. <li><a class="reference" href="#getChildCount.e%2CNodePtr"
  147. title="getChildCount(self: NodePtr): int"><wbr />get<wbr />Child<wbr />Count<span class="attachedType">NodePtr</span></a></li>
  148. <li><a class="reference" href="#getChildIndex.e%2CNodePtr%2Cstring"
  149. title="getChildIndex(self: NodePtr; name: string): int"><wbr />get<wbr />Child<wbr />Index<span class="attachedType">NodePtr</span></a></li>
  150. <li><a class="reference" href="#getChildIndex.e%2CNodePtr%2CNodePtr"
  151. title="getChildIndex(self: NodePtr; child: NodePtr): int"><wbr />get<wbr />Child<wbr />Index<span class="attachedType">NodePtr</span></a></li>
  152. <li><a class="reference" href="#getChildIter.e%2CNodePtr"
  153. title="getChildIter(self: NodePtr): seq[NodePtr]"><wbr />get<wbr />Child<wbr />Iter<span class="attachedType">NodePtr</span></a></li>
  154. <li><a class="reference" href="#getNode.e%2CNodePtr%2Cstring"
  155. title="getNode(self: NodePtr; path: string): NodePtr"><wbr />get<wbr />Node<span class="attachedType">NodePtr</span></a></li>
  156. <li><a class="reference" href="#getPath.e%2CNodePtr"
  157. title="getPath(self: NodePtr): string"><wbr />get<wbr />Path<span class="attachedType">NodePtr</span></a></li>
  158. <li><a class="reference" href="#getParent.e%2CNodePtr"
  159. title="getParent(self: NodePtr): NodePtr"><wbr />get<wbr />Parent<span class="attachedType">NodePtr</span></a></li>
  160. <li><a class="reference" href="#getPauseMode.e%2CNodePtr"
  161. title="getPauseMode(self: NodePtr): PauseMode"><wbr />get<wbr />Pause<wbr />Mode<span class="attachedType">NodePtr</span></a></li>
  162. <li><a class="reference" href="#isParentOf.e%2CNodePtr%2CNodePtr"
  163. title="isParentOf(self, other: NodePtr): bool"><wbr />is<wbr />Parent<wbr />Of<span class="attachedType">NodePtr</span></a></li>
  164. <li><a class="reference" href="#handle.e%2CNodePtr%2CInputEvent%2CNodePtr"
  165. title="handle(self: NodePtr; event: InputEvent; mouse_on: var NodePtr)"><wbr />handle<span class="attachedType">NodePtr</span></a></li>
  166. <li><a class="reference" href="#hasNode.e%2CNodePtr%2Cstring"
  167. title="hasNode(self: NodePtr; name: string): bool"><wbr />has<wbr />Node<span class="attachedType">NodePtr</span></a></li>
  168. <li><a class="reference" href="#hasNode.e%2CNodePtr%2CNodePtr"
  169. title="hasNode(self: NodePtr; other: NodePtr): bool"><wbr />has<wbr />Node<span class="attachedType">NodePtr</span></a></li>
  170. <li><a class="reference" href="#hasParent.e%2CNodePtr"
  171. title="hasParent(self: NodePtr): bool"><wbr />has<wbr />Parent<span class="attachedType">NodePtr</span></a></li>
  172. <li><a class="reference" href="#hide.e%2CNodePtr"
  173. title="hide(self: NodePtr)"><wbr />hide<span class="attachedType">NodePtr</span></a></li>
  174. <li><a class="reference" href="#move.e%2CNodePtr%2Cfloat%2Cfloat"
  175. title="move(self: NodePtr; x, y: float)"><wbr />move<span class="attachedType">NodePtr</span></a></li>
  176. <li><a class="reference" href="#move.e%2CNodePtr%2CVector2Ref"
  177. title="move(self: NodePtr; vec2: Vector2Ref)"><wbr />move<span class="attachedType">NodePtr</span></a></li>
  178. <li><a class="reference" href="#removeChild.e%2CNodePtr%2Cint"
  179. title="removeChild(self: NodePtr; index: int)"><wbr />remove<wbr />Child<span class="attachedType">NodePtr</span></a></li>
  180. <li><a class="reference" href="#removeChild.e%2CNodePtr%2CNodePtr"
  181. title="removeChild(self: NodePtr; other: NodePtr)"><wbr />remove<wbr />Child<span class="attachedType">NodePtr</span></a></li>
  182. <li><a class="reference" href="#setAnchor.e%2CNodePtr%2CAnchorRef"
  183. title="setAnchor(self: NodePtr; anchor: AnchorRef)"><wbr />set<wbr />Anchor<span class="attachedType">NodePtr</span></a></li>
  184. <li><a class="reference" href="#setAnchor.e%2CNodePtr%2Cfloat%2Cfloat%2Cfloat%2Cfloat"
  185. title="setAnchor(self: NodePtr; x1, y1, x2, y2: float)"><wbr />set<wbr />Anchor<span class="attachedType">NodePtr</span></a></li>
  186. <li><a class="reference" href="#setSizeAnchor.e%2CNodePtr%2CVector2Ref"
  187. title="setSizeAnchor(self: NodePtr; anchor: Vector2Ref)"><wbr />set<wbr />Size<wbr />Anchor<span class="attachedType">NodePtr</span></a></li>
  188. <li><a class="reference" href="#setSizeAnchor.e%2CNodePtr%2Cfloat%2Cfloat"
  189. title="setSizeAnchor(self: NodePtr; x, y: float)"><wbr />set<wbr />Size<wbr />Anchor<span class="attachedType">NodePtr</span></a></li>
  190. <li><a class="reference" href="#show.e%2CNodePtr"
  191. title="show(self: NodePtr)"><wbr />show<span class="attachedType">NodePtr</span></a></li>
  192. <li><a class="reference" href="#delete.e%2CNodePtr"
  193. title="delete(self: NodePtr)"><wbr />delete<span class="attachedType">NodePtr</span></a></li>
  194. </ul>
  195. </li>
  196. <li>
  197. <a class="reference reference-toplevel" href="#18" id="68">Templates</a>
  198. <ul class="simple simple-toc-section">
  199. <li><a class="reference" href="#nodepattern.t%2Cuntyped"
  200. title="nodepattern(nodetype: untyped): untyped"><wbr />nodepattern<span class="attachedType"></span></a></li>
  201. </ul>
  202. </li>
  203. </ul>
  204. </div>
  205. <div class="nine columns" id="content">
  206. <div id="tocRoot"></div>
  207. <p class="module-desc"></p>
  208. <div class="section" id="6">
  209. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  210. <dl class="item">
  211. <a class="reference external" href="opengl.html">opengl</a>, <a class="reference external" href="vector2.html">vector2</a>, <a class="reference external" href="enums.html">enums</a>, <a class="reference external" href="anchor.html">anchor</a>, <a class="reference external" href="input.html">input</a>
  212. </dl></div>
  213. <div class="section" id="7">
  214. <h1><a class="toc-backref" href="#7">Types</a></h1>
  215. <dl class="item">
  216. <a id="NodeObj"></a>
  217. <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>
  218. <span class="Identifier">visible</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  219. <span class="Identifier">is_ready</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  220. <span class="Identifier">can_use_anchor</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  221. <span class="Identifier">can_use_size_anchor</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
  222. <span class="Identifier">pausemode</span><span class="Operator">*</span><span class="Other">:</span> <a href="enums.html#PauseMode"><span class="Identifier">PauseMode</span></a> <span class="Comment">## Pause mode, by default is INHERIT.</span>
  223. <span class="Identifier">name</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## Node name.</span>
  224. <span class="Identifier">position</span><span class="Operator">*</span><span class="Other">:</span> <a href="vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</span></a> <span class="Comment">## Node position, by default is Vector2(0, 0).</span>
  225. <span class="Identifier">global_position</span><span class="Operator">*</span><span class="Other">:</span> <a href="vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</span></a> <span class="Comment">## Node global position.</span>
  226. <span class="Identifier">rect_size</span><span class="Operator">*</span><span class="Other">:</span> <a href="vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</span></a> <span class="Comment">## Node size.</span>
  227. <span class="Identifier">size_anchor</span><span class="Operator">*</span><span class="Other">:</span> <a href="vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</span></a> <span class="Comment">## Node size anchor.</span>
  228. <span class="Identifier">anchor</span><span class="Operator">*</span><span class="Other">:</span> <a href="anchor.html#AnchorRef"><span class="Identifier">AnchorRef</span></a> <span class="Comment">## Node anchor.</span>
  229. <span class="Identifier">parent</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a> <span class="Comment">## Node parent.</span>
  230. <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#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">]</span> <span class="Comment">## Node children.</span>
  231. <span class="Identifier">enter</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span> <span class="Comment">## This called when scene changed.</span>
  232. <span class="Identifier">exit</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span> <span class="Comment">## This called when exit from the scene.</span>
  233. <span class="Identifier">input</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">event</span><span class="Other">:</span> <a href="input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">)</span> <span class="Comment">## This called on user input.</span>
  234. <span class="Identifier">ready</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span> <span class="Comment">## This called when the scene changed and the `enter` was called.</span>
  235. <span class="Identifier">process</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Other">)</span> <span class="Comment">## This called every frame.</span>
  236. </pre></dt>
  237. <dd>
  238. </dd>
  239. <a id="NodePtr"></a>
  240. <dt><pre><a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a> <span class="Other">=</span> <span class="Keyword">ptr</span> <a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a></pre></dt>
  241. <dd>
  242. </dd>
  243. </dl></div>
  244. <div class="section" id="12">
  245. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  246. <dl class="item">
  247. <a id="Node,string,NodeObj"></a>
  248. <dt><pre><span class="Keyword">proc</span> <a href="#Node%2Cstring%2CNodeObj"><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="Identifier">variable</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  249. <dd>
  250. Creates a new Node pointer.
  251. </dd>
  252. <a id="Node,NodeObj"></a>
  253. <dt><pre><span class="Keyword">proc</span> <a href="#Node%2CNodeObj"><span class="Identifier">Node</span></a><span class="Other">(</span><span class="Identifier">variable</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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">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>
  254. <dd>
  255. </dd>
  256. </dl></div>
  257. <div class="section" id="14">
  258. <h1><a class="toc-backref" href="#14">Methods</a></h1>
  259. <dl class="item">
  260. <a id="addChild.e,NodePtr,NodePtr"></a>
  261. <dt><pre><span class="Keyword">method</span> <a href="#addChild.e%2CNodePtr%2CNodePtr"><span class="Identifier">addChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">child</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  262. <dd>
  263. <p>Adds new child in current node.</p>
  264. <p>Arguments:</p>
  265. <ul class="simple"><li><tt class="docutils literal"><span class="pre">child</span></tt>: other node.</li>
  266. </ul>
  267. </dd>
  268. <a id="calcGlobalPosition.e,NodePtr"></a>
  269. <dt><pre><span class="Keyword">method</span> <a href="#calcGlobalPosition.e%2CNodePtr"><span class="Identifier">calcGlobalPosition</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  270. <dd>
  271. Returns global node position.
  272. </dd>
  273. <a id="calcPositionAnchor.e,NodePtr"></a>
  274. <dt><pre><span class="Keyword">method</span> <a href="#calcPositionAnchor.e%2CNodePtr"><span class="Identifier">calcPositionAnchor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  275. <dd>
  276. Calculates node position with anchor. This used in the Window object.
  277. </dd>
  278. <a id="draw.e,NodePtr,GLfloat,GLfloat"></a>
  279. <dt><pre><span class="Keyword">method</span> <a href="#draw.e%2CNodePtr%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#NodePtr"><span class="Identifier">NodePtr</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="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>
  280. <dd>
  281. Draws node. This used in the Window object.
  282. </dd>
  283. <a id="draw2stage.e,NodePtr,GLfloat,GLfloat"></a>
  284. <dt><pre><span class="Keyword">method</span> <a href="#draw2stage.e%2CNodePtr%2CGLfloat%2CGLfloat"><span class="Identifier">draw2stage</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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="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>
  285. <dd>
  286. Draws node. This used in the Window object.
  287. </dd>
  288. <a id="duplicate.e,NodePtr,NodeObj"></a>
  289. <dt><pre><span class="Keyword">method</span> <a href="#duplicate.e%2CNodePtr%2CNodeObj"><span class="Identifier">duplicate</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">obj</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  290. <dd>
  291. Duplicates Node object and create a new Node pointer.
  292. </dd>
  293. <a id="getChild.e,NodePtr,int"></a>
  294. <dt><pre><span class="Keyword">method</span> <a href="#getChild.e%2CNodePtr%2Cint"><span class="Identifier">getChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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#NodePtr"><span class="Identifier">NodePtr</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>
  295. <dd>
  296. <p>Returns child at <tt class="docutils literal"><span class="pre">index</span></tt> position, if available.</p>
  297. <p>Arguments:</p>
  298. <ul class="simple"><li><tt class="docutils literal"><span class="pre">index</span></tt>: child index.</li>
  299. </ul>
  300. </dd>
  301. <a id="getChildCount.e,NodePtr"></a>
  302. <dt><pre><span class="Keyword">method</span> <a href="#getChildCount.e%2CNodePtr"><span class="Identifier">getChildCount</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  303. <dd>
  304. Returns child count.
  305. </dd>
  306. <a id="getChildIndex.e,NodePtr,string"></a>
  307. <dt><pre><span class="Keyword">method</span> <a href="#getChildIndex.e%2CNodePtr%2Cstring"><span class="Identifier">getChildIndex</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  308. <dd>
  309. Returns <tt class="docutils literal"><span class="pre">child</span></tt> index or -1, if another node is not the child.
  310. </dd>
  311. <a id="getChildIndex.e,NodePtr,NodePtr"></a>
  312. <dt><pre><span class="Keyword">method</span> <a href="#getChildIndex.e%2CNodePtr%2CNodePtr"><span class="Identifier">getChildIndex</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">child</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  313. <dd>
  314. Returns <tt class="docutils literal"><span class="pre">child</span></tt> index or -1, if another node is not the child.
  315. </dd>
  316. <a id="getChildIter.e,NodePtr"></a>
  317. <dt><pre><span class="Keyword">method</span> <a href="#getChildIter.e%2CNodePtr"><span class="Identifier">getChildIter</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  318. <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>
  319. <dd>
  320. Returns all children iter.
  321. </dd>
  322. <a id="getNode.e,NodePtr,string"></a>
  323. <dt><pre><span class="Keyword">method</span> <a href="#getNode.e%2CNodePtr%2Cstring"><span class="Identifier">getNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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#NodePtr"><span class="Identifier">NodePtr</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>
  324. <dd>
  325. Returns child by <tt class="docutils literal"><span class="pre">path</span></tt>
  326. </dd>
  327. <a id="getPath.e,NodePtr"></a>
  328. <dt><pre><span class="Keyword">method</span> <a href="#getPath.e%2CNodePtr"><span class="Identifier">getPath</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  329. <dd>
  330. Returns node path.
  331. </dd>
  332. <a id="getParent.e,NodePtr"></a>
  333. <dt><pre><span class="Keyword">method</span> <a href="#getParent.e%2CNodePtr"><span class="Identifier">getParent</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  334. <dd>
  335. Returns node parent.
  336. </dd>
  337. <a id="getPauseMode.e,NodePtr"></a>
  338. <dt><pre><span class="Keyword">method</span> <a href="#getPauseMode.e%2CNodePtr"><span class="Identifier">getPauseMode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">)</span><span class="Other">:</span> <a href="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>
  339. <dd>
  340. Calculates pause mode
  341. </dd>
  342. <a id="isParentOf.e,NodePtr,NodePtr"></a>
  343. <dt><pre><span class="Keyword">method</span> <a href="#isParentOf.e%2CNodePtr%2CNodePtr"><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#NodePtr"><span class="Identifier">NodePtr</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>
  344. <dd>
  345. </dd>
  346. <a id="handle.e,NodePtr,InputEvent,NodePtr"></a>
  347. <dt><pre><span class="Keyword">method</span> <a href="#handle.e%2CNodePtr%2CInputEvent%2CNodePtr"><span class="Identifier">handle</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="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#NodePtr"><span class="Identifier">NodePtr</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>
  348. <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>
  349. <dd>
  350. Handles user input. This used in the Window object.
  351. </dd>
  352. <a id="hasNode.e,NodePtr,string"></a>
  353. <dt><pre><span class="Keyword">method</span> <a href="#hasNode.e%2CNodePtr%2Cstring"><span class="Identifier">hasNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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">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>
  354. <dd>
  355. <p>Returns true, if a node with name <tt class="docutils literal"><span class="pre">name</span></tt> in children.</p>
  356. <p>Arguments:</p>
  357. <ul class="simple"><li><tt class="docutils literal"><span class="pre">name</span></tt>: node name.</li>
  358. </ul>
  359. </dd>
  360. <a id="hasNode.e,NodePtr,NodePtr"></a>
  361. <dt><pre><span class="Keyword">method</span> <a href="#hasNode.e%2CNodePtr%2CNodePtr"><span class="Identifier">hasNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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">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>
  362. <dd>
  363. <p>Returns true, if <tt class="docutils literal"><span class="pre">other</span></tt> in self children.</p>
  364. <p>Arguments:</p>
  365. <ul class="simple"><li><tt class="docutils literal"><span class="pre">other</span></tt>: other node.</li>
  366. </ul>
  367. </dd>
  368. <a id="hasParent.e,NodePtr"></a>
  369. <dt><pre><span class="Keyword">method</span> <a href="#hasParent.e%2CNodePtr"><span class="Identifier">hasParent</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  370. <dd>
  371. Returns true, when node has parent.
  372. </dd>
  373. <a id="hide.e,NodePtr"></a>
  374. <dt><pre><span class="Keyword">method</span> <a href="#hide.e%2CNodePtr"><span class="Identifier">hide</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  375. <dd>
  376. </dd>
  377. <a id="move.e,NodePtr,float,float"></a>
  378. <dt><pre><span class="Keyword">method</span> <a href="#move.e%2CNodePtr%2Cfloat%2Cfloat"><span class="Identifier">move</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</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">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>
  379. <dd>
  380. <p>Adds <tt class="docutils literal"><span class="pre">x</span></tt> and` y` to the node position.</p>
  381. <p>Arguments:</p>
  382. <ul class="simple"><li><tt class="docutils literal"><span class="pre">x</span></tt>: how much to add to the position on the X axis.</li>
  383. <li><tt class="docutils literal"><span class="pre">y</span></tt>: how much to add to the position on the Y axis.</li>
  384. </ul>
  385. </dd>
  386. <a id="move.e,NodePtr,Vector2Ref"></a>
  387. <dt><pre><span class="Keyword">method</span> <a href="#move.e%2CNodePtr%2CVector2Ref"><span class="Identifier">move</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">vec2</span><span class="Other">:</span> <a href="vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</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">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>
  388. <dd>
  389. <p>Adds <tt class="docutils literal"><span class="pre">vec2</span></tt> to the node position.</p>
  390. <p>Arguments:</p>
  391. <ul class="simple"><li><tt class="docutils literal"><span class="pre">vec2</span></tt>: how much to add to the position on the X,Y axes.</li>
  392. </ul>
  393. </dd>
  394. <a id="removeChild.e,NodePtr,int"></a>
  395. <dt><pre><span class="Keyword">method</span> <a href="#removeChild.e%2CNodePtr%2Cint"><span class="Identifier">removeChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  396. <dd>
  397. <p>Removes node child at a specific position.</p>
  398. <p>Arguments:</p>
  399. <ul class="simple"><li><tt class="docutils literal"><span class="pre">index</span></tt>: child index.</li>
  400. </ul>
  401. </dd>
  402. <a id="removeChild.e,NodePtr,NodePtr"></a>
  403. <dt><pre><span class="Keyword">method</span> <a href="#removeChild.e%2CNodePtr%2CNodePtr"><span class="Identifier">removeChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  404. <dd>
  405. <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>
  406. <p>Arguments:</p>
  407. <ul class="simple"><li><tt class="docutils literal"><span class="pre">other</span></tt>: other node.</li>
  408. </ul>
  409. </dd>
  410. <a id="setAnchor.e,NodePtr,AnchorRef"></a>
  411. <dt><pre><span class="Keyword">method</span> <a href="#setAnchor.e%2CNodePtr%2CAnchorRef"><span class="Identifier">setAnchor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">anchor</span><span class="Other">:</span> <a href="anchor.html#AnchorRef"><span class="Identifier">AnchorRef</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. <p>Changes node anchor.</p>
  414. <p>Arguments:</p>
  415. <ul class="simple"><li><tt class="docutils literal"><span class="pre">anchor</span></tt> - AnchorRef object.</li>
  416. </ul>
  417. </dd>
  418. <a id="setAnchor.e,NodePtr,float,float,float,float"></a>
  419. <dt><pre><span class="Keyword">method</span> <a href="#setAnchor.e%2CNodePtr%2Cfloat%2Cfloat%2Cfloat%2Cfloat"><span class="Identifier">setAnchor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">x1</span><span class="Other">,</span> <span class="Identifier">y1</span><span class="Other">,</span> <span class="Identifier">x2</span><span class="Other">,</span> <span class="Identifier">y2</span><span class="Other">:</span> <span class="Identifier">float</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>
  420. <dd>
  421. <p>Changes node anchor.</p>
  422. <p>Arguments:</p>
  423. <ul class="simple"><li><tt class="docutils literal"><span class="pre">x1</span></tt> and <tt class="docutils literal"><span class="pre">y1</span></tt> - anchor relative to the parent node.</li>
  424. <li><tt class="docutils literal"><span class="pre">x2</span></tt> and <tt class="docutils literal"><span class="pre">y2</span></tt> - anchor relative to this node.</li>
  425. </ul>
  426. </dd>
  427. <a id="setSizeAnchor.e,NodePtr,Vector2Ref"></a>
  428. <dt><pre><span class="Keyword">method</span> <a href="#setSizeAnchor.e%2CNodePtr%2CVector2Ref"><span class="Identifier">setSizeAnchor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">anchor</span><span class="Other">:</span> <a href="vector2.html#Vector2Ref"><span class="Identifier">Vector2Ref</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>
  429. <dd>
  430. </dd>
  431. <a id="setSizeAnchor.e,NodePtr,float,float"></a>
  432. <dt><pre><span class="Keyword">method</span> <a href="#setSizeAnchor.e%2CNodePtr%2Cfloat%2Cfloat"><span class="Identifier">setSizeAnchor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">,</span> <span class="Identifier">y</span><span class="Other">:</span> <span class="Identifier">float</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>
  433. <dd>
  434. </dd>
  435. <a id="show.e,NodePtr"></a>
  436. <dt><pre><span class="Keyword">method</span> <a href="#show.e%2CNodePtr"><span class="Identifier">show</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  437. <dd>
  438. </dd>
  439. <a id="delete.e,NodePtr"></a>
  440. <dt><pre><span class="Keyword">method</span> <a href="#delete.e%2CNodePtr"><span class="Identifier">delete</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodePtr"><span class="Identifier">NodePtr</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>
  441. <dd>
  442. Deletes current node.
  443. </dd>
  444. </dl></div>
  445. <div class="section" id="18">
  446. <h1><a class="toc-backref" href="#18">Templates</a></h1>
  447. <dl class="item">
  448. <a id="nodepattern.t,untyped"></a>
  449. <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>
  450. <dd>
  451. This used in childs of the NodeObj.
  452. </dd>
  453. </dl></div>
  454. </div>
  455. </div>
  456. <div class="row">
  457. <div class="twelve-columns footer">
  458. <span class="nim-sprite"></span>
  459. <br/>
  460. <small style="color: var(--hint);">Made with Nim. Generated: 2020-05-25 16:01:31 UTC</small>
  461. </div>
  462. </div>
  463. </div>
  464. </div>
  465. </body>
  466. </html>