123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <?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/graphics/drawable</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/graphics/drawable</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">
- <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="#DrawableObj"
- title="DrawableObj = object of RootObj
- shadow*: bool
- border_width*: float
- border_detail*: array[4, int] ## left-top, right-top, right-bottom, left-bottom
- border_radius*: array[4, float] ## left-top, right-top, right-bottom, left-bottom
- shadow_offset*: Vector2Obj
- border_color*: ColorRef
- shadow_color*: ColorRef
- background_color*: ColorRef
- texture*: GlTextureObj"><wbr />Drawable<wbr />Obj<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#DrawableRef"
- title="DrawableRef = ref DrawableObj"><wbr />Drawable<wbr />Ref<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="#Drawable"
- title="Drawable(): DrawableRef"><wbr />Drawable<span class="attachedType">DrawableRef</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="#enableShadow.e%2CDrawableRef%2Cbool"
- title="enableShadow(self: DrawableRef; val: bool = true)"><wbr />enable<wbr />Shadow<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#draw.e%2CDrawableRef%2Cfloat%2Cfloat%2Cfloat%2Cfloat"
- title="draw(self: DrawableRef; x1, y1, width, height: float)"><wbr />draw<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#getColor.e%2CDrawableRef"
- title="getColor(self: DrawableRef): ColorRef"><wbr />get<wbr />Color<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#loadTexture.e%2CDrawableRef%2Cstring"
- title="loadTexture(self: DrawableRef; path: string)"><wbr />load<wbr />Texture<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setBorderColor.e%2CDrawableRef%2CColorRef"
- title="setBorderColor(self: DrawableRef; color: ColorRef)"><wbr />set<wbr />Border<wbr />Color<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setBorderWidth.e%2CDrawableRef%2Cfloat"
- title="setBorderWidth(self: DrawableRef; width: float)"><wbr />set<wbr />Border<wbr />Width<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setColor.e%2CDrawableRef%2CColorRef"
- title="setColor(self: DrawableRef; color: ColorRef)"><wbr />set<wbr />Color<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setCornerRadius.e%2CDrawableRef%2Cfloat"
- title="setCornerRadius(self: DrawableRef; radius: float)"><wbr />set<wbr />Corner<wbr />Radius<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setCornerRadius.e%2CDrawableRef%2Cfloat%2Cfloat%2Cfloat%2Cfloat"
- title="setCornerRadius(self: DrawableRef; r1, r2, r3, r4: float)"><wbr />set<wbr />Corner<wbr />Radius<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setCornerDetail.e%2CDrawableRef%2Cint"
- title="setCornerDetail(self: DrawableRef; detail: int)"><wbr />set<wbr />Corner<wbr />Detail<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setCornerDetail.e%2CDrawableRef%2Cint%2Cint%2Cint%2Cint"
- title="setCornerDetail(self: DrawableRef; d1, d2, d3, d4: int)"><wbr />set<wbr />Corner<wbr />Detail<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setTexture.e%2CDrawableRef%2CGlTextureObj"
- title="setTexture(self: DrawableRef; texture: GlTextureObj)"><wbr />set<wbr />Texture<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setShadowColor.e%2CDrawableRef%2CColorRef"
- title="setShadowColor(self: DrawableRef; clr: ColorRef)"><wbr />set<wbr />Shadow<wbr />Color<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setShadowOffset.e%2CDrawableRef%2CVector2Obj"
- title="setShadowOffset(self: DrawableRef; offset: Vector2Obj)"><wbr />set<wbr />Shadow<wbr />Offset<span class="attachedType">DrawableRef</span></a></li>
- <li><a class="reference" href="#setStyle.e%2CDrawableRef%2CStyleSheetRef"
- title="setStyle(self: DrawableRef; s: StyleSheetRef)"><wbr />set<wbr />Style<span class="attachedType">DrawableRef</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="#drawablepattern.t%2Cuntyped"
- title="drawablepattern(`type`: untyped): untyped"><wbr />drawablepattern<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#vd.t"
- title="vd()"><wbr />vd<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#recalc.t%2Cbool"
- title="recalc(shadow: bool = false)"><wbr />recalc<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#draw_template.t%2Cuntyped%2Cuntyped%2Cuntyped%2Cuntyped"
- title="draw_template(drawtype, color, function, secondfunc: untyped): untyped"><wbr />draw_<wbr />template<span class="attachedType"></span></a></li>
- <li><a class="reference" href="#draw_texture_template.t%2Cuntyped%2Cuntyped%2Cuntyped%2Cuntyped"
- title="draw_texture_template(drawtype, color, function, secondfunc: untyped): untyped"><wbr />draw_<wbr />texture_<wbr />template<span class="attachedType"></span></a></li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="nine columns" id="content">
- <div id="tocRoot"></div>
-
- <p class="module-desc"></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/color.html">../core/color</a>, <a class="reference external" href="../core/stylesheet.html">../core/stylesheet</a>, <a class="reference external" href="../core/image.html">../core/image</a>, <a class="reference external" href="../core/vector2.html">../core/vector2</a>, <a class="reference external" href="../core/tools.html">../core/tools</a>
- </dl></div>
- <div class="section" id="7">
- <h1><a class="toc-backref" href="#7">Types</a></h1>
- <dl class="item">
- <a id="DrawableObj"></a>
- <dt><pre><a href="drawable.html#DrawableObj"><span class="Identifier">DrawableObj</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">RootObj</span>
- <span class="Identifier">shadow</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
- <span class="Identifier">border_width</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">float</span>
- <span class="Identifier">border_detail</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">array</span><span class="Other">[</span><span class="DecNumber">4</span><span class="Other">,</span> <span class="Identifier">int</span><span class="Other">]</span> <span class="Comment">## left-top, right-top, right-bottom, left-bottom</span>
- <span class="Identifier">border_radius</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">array</span><span class="Other">[</span><span class="DecNumber">4</span><span class="Other">,</span> <span class="Identifier">float</span><span class="Other">]</span> <span class="Comment">## left-top, right-top, right-bottom, left-bottom</span>
- <span class="Identifier">shadow_offset</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/vector2.html#Vector2Obj"><span class="Identifier">Vector2Obj</span></a>
- <span class="Identifier">border_color</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</span></a>
- <span class="Identifier">shadow_color</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</span></a>
- <span class="Identifier">background_color</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</span></a>
- <span class="Identifier">texture</span><span class="Operator">*</span><span class="Other">:</span> <a href="../core/image.html#GlTextureObj"><span class="Identifier">GlTextureObj</span></a>
- </pre></dt>
- <dd>
- </dd>
- <a id="DrawableRef"></a>
- <dt><pre><a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <a href="drawable.html#DrawableObj"><span class="Identifier">DrawableObj</span></a></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="Drawable"></a>
- <dt><pre><span class="Keyword">proc</span> <a href="#Drawable"><span class="Identifier">Drawable</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</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>
- </dd>
- </dl></div>
- <div class="section" id="14">
- <h1><a class="toc-backref" href="#14">Methods</a></h1>
- <dl class="item">
- <a id="enableShadow.e,DrawableRef,bool"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#enableShadow.e%2CDrawableRef%2Cbool"><span class="Identifier">enableShadow</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">val</span><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">true</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>
- Enables shadow, when <tt class="docutils literal"><span class="pre">val</span></tt> is true.
- </dd>
- <a id="draw.e,DrawableRef,float,float,float,float"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#draw.e%2CDrawableRef%2Cfloat%2Cfloat%2Cfloat%2Cfloat"><span class="Identifier">draw</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</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">width</span><span class="Other">,</span> <span class="Identifier">height</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="Identifier">GLerror</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="getColor.e,DrawableRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#getColor.e%2CDrawableRef"><span class="Identifier">getColor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">)</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</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 background color.
- </dd>
- <a id="loadTexture.e,DrawableRef,string"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#loadTexture.e%2CDrawableRef%2Cstring"><span class="Identifier">loadTexture</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</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><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">ResourceError</span><span class="Other">,</span> <span class="Identifier">GLerror</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>Loads texture from the file.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">path</span></tt> is an image path.</li>
- </ul>
- </dd>
- <a id="setBorderColor.e,DrawableRef,ColorRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setBorderColor.e%2CDrawableRef%2CColorRef"><span class="Identifier">setBorderColor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">color</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</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>
- Changes border color.
- </dd>
- <a id="setBorderWidth.e,DrawableRef,float"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setBorderWidth.e%2CDrawableRef%2Cfloat"><span class="Identifier">setBorderWidth</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">width</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>
- <dd>
- Changes border width.
- </dd>
- <a id="setColor.e,DrawableRef,ColorRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setColor.e%2CDrawableRef%2CColorRef"><span class="Identifier">setColor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">color</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</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>
- Changes background color.
- </dd>
- <a id="setCornerRadius.e,DrawableRef,float"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setCornerRadius.e%2CDrawableRef%2Cfloat"><span class="Identifier">setCornerRadius</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">radius</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>
- <dd>
- <p>Changes corners radius.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">radius</span></tt> is a new corner radius.</li>
- </ul>
- </dd>
- <a id="setCornerRadius.e,DrawableRef,float,float,float,float"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setCornerRadius.e%2CDrawableRef%2Cfloat%2Cfloat%2Cfloat%2Cfloat"><span class="Identifier">setCornerRadius</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">r1</span><span class="Other">,</span> <span class="Identifier">r2</span><span class="Other">,</span> <span class="Identifier">r3</span><span class="Other">,</span> <span class="Identifier">r4</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>
- <dd>
- <p>Changes corners radius.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">r1</span></tt> is a new left-top radius.</li>
- <li><tt class="docutils literal"><span class="pre">r2</span></tt> is a new right-top radius.</li>
- <li><tt class="docutils literal"><span class="pre">r3</span></tt> is a new right-bottm radius.</li>
- <li><tt class="docutils literal"><span class="pre">r4</span></tt> is a new left-bottm radius.</li>
- </ul>
- </dd>
- <a id="setCornerDetail.e,DrawableRef,int"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setCornerDetail.e%2CDrawableRef%2Cint"><span class="Identifier">setCornerDetail</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">detail</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>Changes corners details.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">detail</span></tt> is a new corner detail.</li>
- </ul>
- </dd>
- <a id="setCornerDetail.e,DrawableRef,int,int,int,int"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setCornerDetail.e%2CDrawableRef%2Cint%2Cint%2Cint%2Cint"><span class="Identifier">setCornerDetail</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">d1</span><span class="Other">,</span> <span class="Identifier">d2</span><span class="Other">,</span> <span class="Identifier">d3</span><span class="Other">,</span> <span class="Identifier">d4</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>Changes corners details.</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">d1</span></tt> is a new left-top detail.</li>
- <li><tt class="docutils literal"><span class="pre">d2</span></tt> is a new right-top detail.</li>
- <li><tt class="docutils literal"><span class="pre">d3</span></tt> is a new right-bottm detail.</li>
- <li><tt class="docutils literal"><span class="pre">d4</span></tt> is a new left-bottm detail.</li>
- </ul>
- </dd>
- <a id="setTexture.e,DrawableRef,GlTextureObj"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setTexture.e%2CDrawableRef%2CGlTextureObj"><span class="Identifier">setTexture</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">texture</span><span class="Other">:</span> <a href="../core/image.html#GlTextureObj"><span class="Identifier">GlTextureObj</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>
- Changes drawable texture.
- </dd>
- <a id="setShadowColor.e,DrawableRef,ColorRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setShadowColor.e%2CDrawableRef%2CColorRef"><span class="Identifier">setShadowColor</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">clr</span><span class="Other">:</span> <a href="../core/color.html#ColorRef"><span class="Identifier">ColorRef</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="setShadowOffset.e,DrawableRef,Vector2Obj"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setShadowOffset.e%2CDrawableRef%2CVector2Obj"><span class="Identifier">setShadowOffset</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">offset</span><span class="Other">:</span> <a href="../core/vector2.html#Vector2Obj"><span class="Identifier">Vector2Obj</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>
- Changes shadow offset.
- </dd>
- <a id="setStyle.e,DrawableRef,StyleSheetRef"></a>
- <dt><pre><span class="Keyword">method</span> <a href="#setStyle.e%2CDrawableRef%2CStyleSheetRef"><span class="Identifier">setStyle</span></a><span class="Other">(</span><span class="Identifier">self</span><span class="Other">:</span> <a href="drawable.html#DrawableRef"><span class="Identifier">DrawableRef</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <a href="../core/stylesheet.html#StyleSheetRef"><span class="Identifier">StyleSheetRef</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">ValueError</span><span class="Other">,</span> <span class="Identifier">RegexError</span><span class="Other">,</span> <span class="Identifier">ResourceError</span><span class="Other">,</span> <span class="Identifier">GLerror</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>Sets new stylesheet.</p>
- <p>Styles:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">background-color</span></tt> - <tt class="docutils literal"><span class="pre">rgb(1, 1, 1)</span></tt>; <tt class="docutils literal"><span class="pre">rgba(1, 1, 1, 1)</span></tt>; <tt class="docutils literal"><span class="pre">#ffef</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">background-image</span></tt> - <tt class="docutils literal"><span class="pre">"assets/image.jpg". - `background</span></tt> - the same as <tt class="docutils literal"><span class="pre">background-image</span></tt> and <tt class="docutils literal"><span class="pre">background-color</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">border-color</span></tt> - the same as <tt class="docutils literal"><span class="pre">background-color</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">border-width</span></tt> - <tt class="docutils literal"><span class="pre">0</span></tt>; <tt class="docutils literal"><span class="pre">8</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">border-detail</span></tt> - corners details. <tt class="docutils literal"><span class="pre">8</span></tt>; <tt class="docutils literal"><span class="pre">8 8 8 8</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">border-radius</span></tt> - corners radius. same as <tt class="docutils literal"><span class="pre">border-detail</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">border</span></tt> - corners radius and border color. <tt class="docutils literal"><span class="pre">8 #ffef</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">shadow</span></tt> - enables shadow. <tt class="docutils literal"><span class="pre">true</span></tt>; <tt class="docutils literal"><span class="pre">yes</span></tt>; <tt class="docutils literal"><span class="pre">on</span></tt>; <tt class="docutils literal"><span class="pre">off</span></tt>; <tt class="docutils literal"><span class="pre">no</span></tt>; <tt class="docutils literal"><span class="pre">false</span></tt>.</li>
- <li><tt class="docutils literal"><span class="pre">shadow-offset</span></tt> - XY shadow offset. <tt class="docutils literal"><span class="pre">3</span></tt>; <tt class="docutils literal"><span class="pre">5 10</span></tt>.</li>
- </ul>
- </dd>
- </dl></div>
- <div class="section" id="18">
- <h1><a class="toc-backref" href="#18">Templates</a></h1>
- <dl class="item">
- <a id="drawablepattern.t,untyped"></a>
- <dt><pre><span class="Keyword">template</span> <a href="#drawablepattern.t%2Cuntyped"><span class="Identifier">drawablepattern</span></a><span class="Other">(</span><span class="Other">`</span><span class="Keyword">type</span><span class="Other">`</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>
- </dd>
- <a id="vd.t"></a>
- <dt><pre><span class="Keyword">template</span> <a href="#vd.t"><span class="Identifier">vd</span></a><span class="Other">(</span><span class="Other">)</span></pre></dt>
- <dd>
- void template
- </dd>
- <a id="recalc.t,bool"></a>
- <dt><pre><span class="Keyword">template</span> <a href="#recalc.t%2Cbool"><span class="Identifier">recalc</span></a><span class="Other">(</span><span class="Identifier">shadow</span><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span></pre></dt>
- <dd>
- Calculates vertex positions.
- </dd>
- <a id="draw_template.t,untyped,untyped,untyped,untyped"></a>
- <dt><pre><span class="Keyword">template</span> <a href="#draw_template.t%2Cuntyped%2Cuntyped%2Cuntyped%2Cuntyped"><span class="Identifier">draw_template</span></a><span class="Other">(</span><span class="Identifier">drawtype</span><span class="Other">,</span> <span class="Identifier">color</span><span class="Other">,</span> <span class="Identifier">function</span><span class="Other">,</span> <span class="Identifier">secondfunc</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>Draws colorized vertexes</p>
- <p>Arguments:</p>
- <ul class="simple"><li><tt class="docutils literal"><span class="pre">drawtype</span></tt> - draw type, like <tt class="docutils literal"><span class="pre">GL_POLYGON</span></tt></li>
- <li><tt class="docutils literal"><span class="pre">color</span></tt> - color for border drawing.</li>
- <li><tt class="docutils literal"><span class="pre">function</span></tt> - function called before <tt class="docutils literal"><span class="pre">glBegin</span></tt></li>
- <li><tt class="docutils literal"><span class="pre">secondfunc</span></tt> - function called after <tt class="docutils literal"><span class="pre">glEnd</span></tt></li>
- </ul>
- </dd>
- <a id="draw_texture_template.t,untyped,untyped,untyped,untyped"></a>
- <dt><pre><span class="Keyword">template</span> <a href="#draw_texture_template.t%2Cuntyped%2Cuntyped%2Cuntyped%2Cuntyped"><span class="Identifier">draw_texture_template</span></a><span class="Other">(</span><span class="Identifier">drawtype</span><span class="Other">,</span> <span class="Identifier">color</span><span class="Other">,</span> <span class="Identifier">function</span><span class="Other">,</span> <span class="Identifier">secondfunc</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>
- </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:12 UTC</small>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
|