node.html 61 KB

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