123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632 |
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <!-- This file is generated by Nim. -->
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <!-- Favicon -->
- <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=="/>
- <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=">
- <!-- Google fonts -->
- <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
- <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
- <!-- CSS -->
- <title>nodesnim/nodes/node</title>
- <link rel="stylesheet" type="text/css" href="../../nimdoc.out.css">
- <script type="text/javascript" src="dochack.js"></script>
- <script type="text/javascript">
- function main() {
- var pragmaDots = document.getElementsByClassName("pragmadots");
- for (var i = 0; i < pragmaDots.length; i++) {
- pragmaDots[i].onclick = function(event) {
- // Hide tease
- event.target.parentNode.style.display = "none";
- // Show actual
- event.target.parentNode.nextElementSibling.style.display = "inline";
- }
- }
- const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
- function switchTheme(e) {
- if (e.target.checked) {
- document.documentElement.setAttribute('data-theme', 'dark');
- localStorage.setItem('theme', 'dark');
- } else {
- document.documentElement.setAttribute('data-theme', 'light');
- localStorage.setItem('theme', 'light');
- }
- }
- toggleSwitch.addEventListener('change', switchTheme, false);
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
- document.documentElement.setAttribute('data-theme', "dark");
- toggleSwitch.checked = true;
- } else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
- document.documentElement.setAttribute('data-theme', "light");
- toggleSwitch.checked = false;
- } else {
- const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
- if (currentTheme) {
- document.documentElement.setAttribute('data-theme', currentTheme);
- if (currentTheme === 'dark') {
- toggleSwitch.checked = true;
- }
- }
- }
- }
- </script>
- </head>
- <body onload="main()">
- <div class="document" id="documentId">
- <div class="container">
- <h1 class="title">nodesnim/nodes/node</h1>
- <div class="row">
- <div class="three columns">
- <div class="theme-switch-wrapper">
- <label class="theme-switch" for="checkbox">
- <input type="checkbox" id="checkbox" />
- <div class="slider round"></div>
- </label>
- <em>Dark Mode</em>
- </div>
- <div id="global-links">
- <ul class="simple">
- </ul>
- </div>
- <div id="searchInputDiv">
- Search: <input type="text" id="searchInput"
- onkeyup="search()" />
- </div>
- <div>
- Group by:
- <select onchange="groupBy(this.value)">
- <option value="section">Section</option>
- <option value="type">Type</option>
- </select>
- </div>
- <ul class="simple simple-toc" id="toc-list">
- <ul class="simple"><li><a class="reference" id="examples_toc" href="#examples">Examples</a></li>
- </ul><li>
- <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
- <ul class="simple simple-toc-section">
-
- </ul>
- </li>
- <li>
- <a class="reference reference-toplevel" href="#7" id="57">Types</a>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#NodeHandler"
- title="NodeHandler = proc (self: NodeRef)"><wbr />Node<wbr />Handler<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#NodeEvHandler"
- title="NodeEvHandler = proc (self: NodeRef; event: InputEvent)"><wbr />Node<wbr />Ev<wbr />Handler<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#NodeObj"
- title="NodeObj = object of RootObj
- kind*: NodeKind
- type_of_node*: NodeTypes ## default, gui, 2d or 3d.
- visibility*: Visibility ## visible, invisible or gone.
- is_ready*: bool ## true, when scene is ready.
- pausemode*: PauseMode ## Pause mode, by default is INHERIT.
- name*: string ## Node name.
- parent*: NodeRef ## Node parent.
- children*: seq[NodeRef] ## Node children.
- on_enter*: NodeHandler ## This called when scene changed.
- on_exit*: NodeHandler ## This called when exit from the scene.
- on_input*: NodeEvHandler ## This called on user input.
- on_ready*: NodeHandler ## This called when the scene changed and the `enter` was called.
- on_process*: NodeHandler ## This called every frame."><wbr />Node<wbr />Obj<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#NodeRef"
- title="NodeRef = ref NodeObj"><wbr />Node<wbr />Ref<span class="attachedType"></span></a></li>
- </ul>
- </li>
- <li>
- <a class="reference reference-toplevel" href="#9" id="59">Lets</a>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#handler_default"
- title="handler_default = proc (self: NodeRef) = discard"><wbr />handler_<wbr />default<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#event_handler_default"
- title="event_handler_default = proc (self: NodeRef; event: InputEvent) = discard"><wbr />event_<wbr />handler_<wbr />default<span class="attachedType"></span></a></li>
- </ul>
- </li>
- <li>
- <a class="reference reference-toplevel" href="#12" id="62">Procs</a>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#Node%2Cstring"
- title="Node(name: string = "Node"): NodeRef"><wbr />Node<span class="attachedType">NodeRef</span></a></li>
- </ul>
- </li>
- <li>
- <a class="reference reference-toplevel" href="#14" id="64">Methods</a>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#addChild.e%2CNodeRef%2CNodeRef"
- title="addChild(self: NodeRef; child: NodeRef)"><wbr />add<wbr />Child<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#addChildren.e%2CNodeRef%2Cvarargs%5BNodeRef%5D"
- title="addChildren(self: NodeRef; childs: varargs[NodeRef])"><wbr />add<wbr />Children<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#draw.e%2CNodeRef%2CGLfloat%2CGLfloat"
- title="draw(self: NodeRef; w, h: GLfloat)"><wbr />draw<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#duplicate.e%2CNodeRef"
- title="duplicate(self: NodeRef): NodeRef"><wbr />duplicate<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getChild.e%2CNodeRef%2Cint"
- title="getChild(self: NodeRef; index: int): NodeRef"><wbr />get<wbr />Child<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getChildCount.e%2CNodeRef"
- title="getChildCount(self: NodeRef): int"><wbr />get<wbr />Child<wbr />Count<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getChildIndex.e%2CNodeRef%2Cstring"
- title="getChildIndex(self: NodeRef; name: string): int"><wbr />get<wbr />Child<wbr />Index<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getChildIndex.e%2CNodeRef%2CNodeRef"
- title="getChildIndex(self: NodeRef; child: NodeRef): int"><wbr />get<wbr />Child<wbr />Index<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getChildIter.e%2CNodeRef"
- title="getChildIter(self: NodeRef): seq[NodeRef]"><wbr />get<wbr />Child<wbr />Iter<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getNode.e%2CNodeRef%2Cstring"
- title="getNode(self: NodeRef; path: string): NodeRef"><wbr />get<wbr />Node<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getPath.e%2CNodeRef"
- title="getPath(self: NodeRef): string"><wbr />get<wbr />Path<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getParent.e%2CNodeRef"
- title="getParent(self: NodeRef): NodeRef"><wbr />get<wbr />Parent<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getPauseMode.e%2CNodeRef"
- title="getPauseMode(self: NodeRef): PauseMode"><wbr />get<wbr />Pause<wbr />Mode<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#getRootNode.e%2CNodeRef"
- title="getRootNode(self: NodeRef): NodeRef"><wbr />get<wbr />Root<wbr />Node<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#isParentOf.e%2CNodeRef%2CNodeRef"
- title="isParentOf(self, other: NodeRef): bool"><wbr />is<wbr />Parent<wbr />Of<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#handle.e%2CNodeRef%2CInputEvent%2CNodeRef"
- title="handle(self: NodeRef; event: InputEvent; mouse_on: var NodeRef)"><wbr />handle<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#hasNode.e%2CNodeRef%2Cstring"
- title="hasNode(self: NodeRef; name: string): bool"><wbr />has<wbr />Node<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#hasNode.e%2CNodeRef%2CNodeRef"
- title="hasNode(self: NodeRef; other: NodeRef): bool"><wbr />has<wbr />Node<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#hasParent.e%2CNodeRef"
- title="hasParent(self: NodeRef): bool"><wbr />has<wbr />Parent<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#hide.e%2CNodeRef"
- title="hide(self: NodeRef)"><wbr />hide<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#postdraw.e%2CNodeRef%2CGLfloat%2CGLfloat"
- title="postdraw(self: NodeRef; w, h: GLfloat)"><wbr />postdraw<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#rename.e%2CNodeRef%2Cstring"
- title="rename(self: NodeRef; new_name: string)"><wbr />rename<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#removeChild.e%2CNodeRef%2Cint"
- title="removeChild(self: NodeRef; index: int)"><wbr />remove<wbr />Child<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#removeChild.e%2CNodeRef%2CNodeRef"
- title="removeChild(self: NodeRef; other: NodeRef)"><wbr />remove<wbr />Child<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#show.e%2CNodeRef"
- title="show(self: NodeRef)"><wbr />show<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#delete.e%2CNodeRef"
- title="delete(self: NodeRef)"><wbr />delete<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#%5B%5D.e%2CNodeRef%2Cint"
- title="`[]`(self: NodeRef; index: int): NodeRef"><wbr />`[]`<span class="attachedType">NodeRef</span></a></li>
- <li><a class="reference" href="#~.e%2CNodeRef%2Cstring"
- title="`~`(self: NodeRef; path: string): NodeRef"><wbr />`~`<span class="attachedType">NodeRef</span></a></li>
- </ul>
- </li>
- <li>
- <a class="reference reference-toplevel" href="#17" id="67">Macros</a>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#%40.m%2CNodeRef%2Cuntyped%2Cuntyped"
- title="`@`(node: NodeRef; event_name, code: untyped): untyped"><wbr />`@`<span class="attachedType">NodeRef</span></a></li>
- </ul>
- </li>
- <li>
- <a class="reference reference-toplevel" href="#18" id="68">Templates</a>
- <ul class="simple simple-toc-section">
- <li><a class="reference" href="#nodepattern.t%2Cuntyped"
- title="nodepattern(nodetype: untyped): untyped"><wbr />nodepattern<span class="attachedType"></span></a></li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="nine columns" id="content">
- <div id="tocRoot"></div>
-
- <p class="module-desc">Node is the root type of all other nodes.</p>
- <div class="section" id="6">
- <h1><a class="toc-backref" href="#6">Imports</a></h1>
- <dl class="item">
- <a class="reference external" href="../thirdparty/opengl.html">../thirdparty/opengl</a>, <a class="reference external" href="../core/vector2.html">../core/vector2</a>, <a class="reference external" href="../core/enums.html">../core/enums</a>, <a class="reference external" href="../core/anchor.html">../core/anchor</a>, <a class="reference external" href="../core/input.html">../core/input</a>
- </dl></div>
- <div class="section" id="7">
- <h1><a class="toc-backref" href="#7">Types</a></h1>
- <dl class="item">
- <a id="NodeHandler"></a>
- <dt><pre><a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span></pre></dt>
- <dd>
- </dd>
- <a id="NodeEvHandler"></a>
- <dt><pre><a href="node.html#NodeEvHandler"><span class="Identifier">NodeEvHandler</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">)</span></pre></dt>
- <dd>
- </dd>
- <a id="NodeObj"></a>
- <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>
- <span class="Identifier">kind</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#NodeKind"><span class="Identifier">NodeKind</span></a>
- <span class="Identifier">type_of_node</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#NodeTypes"><span class="Identifier">NodeTypes</span></a> <span class="Comment">## default, gui, 2d or 3d.</span>
- <span class="Identifier">visibility</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#Visibility"><span class="Identifier">Visibility</span></a> <span class="Comment">## visible, invisible or gone.</span>
- <span class="Identifier">is_ready</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Comment">## true, when scene is ready.</span>
- <span class="Identifier">pausemode</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/enums.html#PauseMode"><span class="Identifier">PauseMode</span></a> <span class="Comment">## Pause mode, by default is INHERIT.</span>
- <span class="Identifier">name</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## Node name.</span>
- <span class="Identifier">parent</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span class="Comment">## Node parent.</span>
- <span class="Identifier">children</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">]</span> <span class="Comment">## Node children.</span>
- <span class="Identifier">on_enter</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called when scene changed.</span>
- <span class="Identifier">on_exit</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called when exit from the scene.</span>
- <span class="Identifier">on_input</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeEvHandler"><span class="Identifier">NodeEvHandler</span></a> <span class="Comment">## This called on user input.</span>
- <span class="Identifier">on_ready</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called when the scene changed and the `enter` was called.</span>
- <span class="Identifier">on_process</span><span class="Operator">*</span><span class="Other">:</span> <a href="node.html#NodeHandler"><span class="Identifier">NodeHandler</span></a> <span class="Comment">## This called every frame.</span>
- </pre></dt>
- <dd>
- </dd>
- <a id="NodeRef"></a>
- <dt><pre><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <a href="node.html#NodeObj"><span class="Identifier">NodeObj</span></a></pre></dt>
- <dd>
- </dd>
- </dl></div>
- <div class="section" id="9">
- <h1><a class="toc-backref" href="#9">Lets</a></h1>
- <dl class="item">
- <a id="handler_default"></a>
- <dt><pre><a href="node.html#handler_default"><span class="Identifier">handler_default</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">discard</span></pre></dt>
- <dd>
- </dd>
- <a id="event_handler_default"></a>
- <dt><pre><a href="node.html#event_handler_default"><span class="Identifier">event_handler_default</span></a> <span class="Other">=</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">)</span> <span class="Other">=</span> <span class="Keyword">discard</span></pre></dt>
- <dd>
- </dd>
- </dl></div>
- <div class="section" id="12">
- <h1><a class="toc-backref" href="#12">Procs</a></h1>
- <dl class="item">
- <a id="Node,string"></a>
- <dt><pre><span class="Keyword">proc</span> <a href="#Node%2Cstring"><span class="Identifier">Node</span></a><span class="Other">(</span><span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Other">=</span> <span class="StringLit">"Node"</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Creates a new Node.
- </dd>
- </dl></div>
- <div class="section" id="14">
- <h1><a class="toc-backref" href="#14">Methods</a></h1>
- <dl class="item">
- <a id="addChild.e,NodeRef,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#addChild.e%2CNodeRef%2CNodeRef"><span class="Identifier">addChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">child</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Adds new child in current node.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">child</span></tt>: other node.</li>
- </ul>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#addChildren.e,NodeRef,varargs[NodeRef]">addChildren method</a></li>
- <li><a class="reference external" href="#getChild.e,NodeRef,int">getChild method</a></li>
- </ul>
- </dd>
- <a id="addChildren.e,NodeRef,varargs[NodeRef]"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#addChildren.e%2CNodeRef%2Cvarargs%5BNodeRef%5D"><span class="Identifier">addChildren</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">childs</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">]</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Adds new child in current node.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">child</span></tt>: other node.</li>
- </ul>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#addChild.e,NodeRef,NodeRef">addChild method</a></li>
- </ul>
- </dd>
- <a id="draw.e,NodeRef,GLfloat,GLfloat"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#draw.e%2CNodeRef%2CGLfloat%2CGLfloat"><span class="Identifier">draw</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">w</span><span class="Other">,</span> <span class="Identifier">h</span><span class="Other">:</span> <a href="../thirdparty/opengl.html#GLfloat"><span class="Identifier">GLfloat</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Draws node. This used in the Window object.
- </dd>
- <a id="duplicate.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#duplicate.e%2CNodeRef"><span class="Identifier">duplicate</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Duplicates Node object and create a new Node.
- </dd>
- <a id="getChild.e,NodeRef,int"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getChild.e%2CNodeRef%2Cint"><span class="Identifier">getChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">index</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Returns child at <tt class="docutils literal"><span class="pre">index</span></tt> position, if available.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">index</span></tt>: child index.</li>
- </ul>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#addChild.e,NodeRef,NodeRef">addChild method</a></li>
- <li><a class="reference external" href="#getChildCount.e,NodeRef">getChildCount method</a></li>
- </ul>
- </dd>
- <a id="getChildCount.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getChildCount.e%2CNodeRef"><span class="Identifier">getChildCount</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Returns child count.</p>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#getChild.e,NodeRef,int">getChild method</a></li>
- </ul>
- </dd>
- <a id="getChildIndex.e,NodeRef,string"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getChildIndex.e%2CNodeRef%2Cstring"><span class="Identifier">getChildIndex</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Returns <tt class="docutils literal"><span class="pre">child</span></tt> index or -1, if another node is not the child.</p>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#getChildIndex.e,NodeRef,NodeRef">getChildIndex method</a></li>
- </ul>
- </dd>
- <a id="getChildIndex.e,NodeRef,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getChildIndex.e%2CNodeRef%2CNodeRef"><span class="Identifier">getChildIndex</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">child</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Returns <tt class="docutils literal"><span class="pre">child</span></tt> index or -1, if another node is not the child.</p>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#getChildIndex.e,NodeRef,string">getChildIndex method</a></li>
- </ul>
- </dd>
- <a id="getChildIter.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getChildIter.e%2CNodeRef"><span class="Identifier">getChildIter</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">]</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
- <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>
- <dd>
- Returns all children iter.
- </dd>
- <a id="getNode.e,NodeRef,string"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getNode.e%2CNodeRef%2Cstring"><span class="Identifier">getNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">path</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Returns child by <tt class="docutils literal"><span class="pre">path</span></tt>
- </dd>
- <a id="getPath.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getPath.e%2CNodeRef"><span class="Identifier">getPath</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Returns node path.
- </dd>
- <a id="getParent.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getParent.e%2CNodeRef"><span class="Identifier">getParent</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Returns node parent.
- </dd>
- <a id="getPauseMode.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getPauseMode.e%2CNodeRef"><span class="Identifier">getPauseMode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="../core/enums.html#PauseMode"><span class="Identifier">PauseMode</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Calculates pause mode
- </dd>
- <a id="getRootNode.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getRootNode.e%2CNodeRef"><span class="Identifier">getRootNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Gets root node.
- </dd>
- <a id="isParentOf.e,NodeRef,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#isParentOf.e%2CNodeRef%2CNodeRef"><span class="Identifier">isParentOf</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">,</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- </dd>
- <a id="handle.e,NodeRef,InputEvent,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#handle.e%2CNodeRef%2CInputEvent%2CNodeRef"><span class="Identifier">handle</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event</span><span class="Other">:</span> <a href="../core/input.html#InputEvent"><span class="Identifier">InputEvent</span></a><span class="Other">;</span> <span class="Identifier">mouse_on</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span>
- <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>
- <dd>
- Handles user input. This used in the Window object.
- </dd>
- <a id="hasNode.e,NodeRef,string"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#hasNode.e%2CNodeRef%2Cstring"><span class="Identifier">hasNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Returns true, if a node with name <tt class="docutils literal"><span class="pre">name</span></tt> in children.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">name</span></tt>: node name.</li>
- </ul>
- </dd>
- <a id="hasNode.e,NodeRef,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#hasNode.e%2CNodeRef%2CNodeRef"><span class="Identifier">hasNode</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Returns true, if <tt class="docutils literal"><span class="pre">other</span></tt> in self children.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">other</span></tt>: other node.</li>
- </ul>
- </dd>
- <a id="hasParent.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#hasParent.e%2CNodeRef"><span class="Identifier">hasParent</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Returns true, when node has parent.
- </dd>
- <a id="hide.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#hide.e%2CNodeRef"><span class="Identifier">hide</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- </dd>
- <a id="postdraw.e,NodeRef,GLfloat,GLfloat"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#postdraw.e%2CNodeRef%2CGLfloat%2CGLfloat"><span class="Identifier">postdraw</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">w</span><span class="Other">,</span> <span class="Identifier">h</span><span class="Other">:</span> <a href="../thirdparty/opengl.html#GLfloat"><span class="Identifier">GLfloat</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Draws node. This used in the Window object.
- </dd>
- <a id="rename.e,NodeRef,string"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#rename.e%2CNodeRef%2Cstring"><span class="Identifier">rename</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">new_name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- </dd>
- <a id="removeChild.e,NodeRef,int"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#removeChild.e%2CNodeRef%2Cint"><span class="Identifier">removeChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">index</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <p>Removes node child at a specific position.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">index</span></tt>: child index.</li>
- </ul>
- <p>See also:</p>
- <ul class="simple"><li><a class="reference external" href="#addChild.e,NodeRef,NodeRef">addChild method</a></li>
- </ul>
- </dd>
- <a id="removeChild.e,NodeRef,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#removeChild.e%2CNodeRef%2CNodeRef"><span class="Identifier">removeChild</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- <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>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">other</span></tt>: other node.</li>
- </ul>
- </dd>
- <a id="show.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#show.e%2CNodeRef"><span class="Identifier">show</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- </dd>
- <a id="delete.e,NodeRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#delete.e%2CNodeRef"><span class="Identifier">delete</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- Deletes current node.
- </dd>
- <a id="[].e,NodeRef,int"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#%5B%5D.e%2CNodeRef%2Cint"><span class="Identifier">`[]`</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">index</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- </dd>
- <a id="~.e,NodeRef,string"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#~.e%2CNodeRef%2Cstring"><span class="Identifier">`~`</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">path</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">base</span><span class="Other">,</span> <span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
- <dd>
- </dd>
- </dl></div>
- <div class="section" id="17">
- <h1><a class="toc-backref" href="#17">Macros</a></h1>
- <dl class="item">
- <a id="@.m,NodeRef,untyped,untyped"></a>
- <dt><pre><span class="Keyword">macro</span> <a href="#%40.m%2CNodeRef%2Cuntyped%2Cuntyped"><span class="Identifier">`@`</span></a><span class="Other">(</span><span class="Identifier">node</span><span class="Other">:</span> <a href="node.html#NodeRef"><span class="Identifier">NodeRef</span></a><span class="Other">;</span> <span class="Identifier">event_name</span><span class="Other">,</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
- <dd>
- <p>It provides a convenient wrapper for the event handler.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">node</span></tt> is an any node pointer.</li>
- <li><tt class="docutils literal"><span class="pre">event_name</span></tt> is an event name, e.g.: process.</li>
- <li><tt class="docutils literal"><span class="pre">code</span></tt> is the proc code.</li>
- </ul>
- <h2><a class="toc-backref" id="examples" href="#examples">Examples</a></h2><pre class="listing"><span class="Keyword">var</span>
- <span class="Identifier">smth_node</span> <span class="Operator">=</span> <span class="Identifier">Node</span><span class="Punctuation">(</span><span class="StringLit">"Simple node"</span><span class="Punctuation">)</span>
- <span class="Identifier">smth_node</span><span class="Operator">@</span><span class="Identifier">on_ready</span><span class="Punctuation">(</span><span class="Identifier">self</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
- <span class="Identifier">echo</span> <span class="StringLit">"node is ready!"</span>
- <span class="Identifier">smth_node</span><span class="Operator">@</span><span class="Identifier">on_input</span><span class="Punctuation">(</span><span class="Identifier">self</span><span class="Punctuation">,</span> <span class="Identifier">event</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
- <span class="Keyword">if</span> <span class="Identifier">event</span><span class="Operator">.</span><span class="Identifier">isInputEventMouseButton</span><span class="Punctuation">(</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
- <span class="Identifier">echo</span> <span class="Identifier">event</span></pre>
- </dd>
- </dl></div>
- <div class="section" id="18">
- <h1><a class="toc-backref" href="#18">Templates</a></h1>
- <dl class="item">
- <a id="nodepattern.t,untyped"></a>
- <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>
- <dd>
- This used in childs of the NodeObj.
- </dd>
- </dl></div>
- </div>
- </div>
- <div class="row">
- <div class="twelve-columns footer">
- <span class="nim-sprite"></span>
- <br/>
- <small style="color: var(--hint);">Made with Nim. Generated: 2021-11-03 16:19:04 UTC</small>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
|