mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-30 18:24:04 +03:00
deploy: 8042ad414f
This commit is contained in:
parent
c8f479a6be
commit
a2143d709f
@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a></p><script>window.sidebarCurrent = {name: 'BUILT_TIME_UTC', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-3c7487281029702d/out/built.rs.html#49' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a>::<wbr><a class="constant" href=''>BUILT_TIME_UTC</a></span></h1><pre class='rust const'>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Mon, 21 Sep 2020 17:36:09 +0000";</pre><div class='docblock'><p>The built-time in RFC2822, UTC</p>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a></p><script>window.sidebarCurrent = {name: 'BUILT_TIME_UTC', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-3c7487281029702d/out/built.rs.html#49' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>pregame</a>::<wbr><a href='index.html'>built_info</a>::<wbr><a class="constant" href=''>BUILT_TIME_UTC</a></span></h1><pre class='rust const'>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Mon, 21 Sep 2020 19:11:09 +0000";</pre><div class='docblock'><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `building` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, building"><title>game::render::building - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module building</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>game</a>::<wbr><a href='../index.html'>render</a></p><script>window.sidebarCurrent = {name: 'building', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/game/render/building.rs.html#1-181' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>render</a>::<wbr><a class="mod" href=''>building</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `building` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, building"><title>game::render::building - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module building</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>game</a>::<wbr><a href='../index.html'>render</a></p><script>window.sidebarCurrent = {name: 'building', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/game/render/building.rs.html#1-245' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>game</a>::<wbr><a href='../index.html'>render</a>::<wbr><a class="mod" href=''>building</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.DrawBuilding.html" title='game::render::building::DrawBuilding struct'>DrawBuilding</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -111,7 +111,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.46.0 (04488afe3 2020-08-24)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Mon, 21 Sep 2020 17:36:09 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Mon, 21 Sep 2020 19:11:09 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -179,6 +179,70 @@
|
||||
<span id="179">179</span>
|
||||
<span id="180">180</span>
|
||||
<span id="181">181</span>
|
||||
<span id="182">182</span>
|
||||
<span id="183">183</span>
|
||||
<span id="184">184</span>
|
||||
<span id="185">185</span>
|
||||
<span id="186">186</span>
|
||||
<span id="187">187</span>
|
||||
<span id="188">188</span>
|
||||
<span id="189">189</span>
|
||||
<span id="190">190</span>
|
||||
<span id="191">191</span>
|
||||
<span id="192">192</span>
|
||||
<span id="193">193</span>
|
||||
<span id="194">194</span>
|
||||
<span id="195">195</span>
|
||||
<span id="196">196</span>
|
||||
<span id="197">197</span>
|
||||
<span id="198">198</span>
|
||||
<span id="199">199</span>
|
||||
<span id="200">200</span>
|
||||
<span id="201">201</span>
|
||||
<span id="202">202</span>
|
||||
<span id="203">203</span>
|
||||
<span id="204">204</span>
|
||||
<span id="205">205</span>
|
||||
<span id="206">206</span>
|
||||
<span id="207">207</span>
|
||||
<span id="208">208</span>
|
||||
<span id="209">209</span>
|
||||
<span id="210">210</span>
|
||||
<span id="211">211</span>
|
||||
<span id="212">212</span>
|
||||
<span id="213">213</span>
|
||||
<span id="214">214</span>
|
||||
<span id="215">215</span>
|
||||
<span id="216">216</span>
|
||||
<span id="217">217</span>
|
||||
<span id="218">218</span>
|
||||
<span id="219">219</span>
|
||||
<span id="220">220</span>
|
||||
<span id="221">221</span>
|
||||
<span id="222">222</span>
|
||||
<span id="223">223</span>
|
||||
<span id="224">224</span>
|
||||
<span id="225">225</span>
|
||||
<span id="226">226</span>
|
||||
<span id="227">227</span>
|
||||
<span id="228">228</span>
|
||||
<span id="229">229</span>
|
||||
<span id="230">230</span>
|
||||
<span id="231">231</span>
|
||||
<span id="232">232</span>
|
||||
<span id="233">233</span>
|
||||
<span id="234">234</span>
|
||||
<span id="235">235</span>
|
||||
<span id="236">236</span>
|
||||
<span id="237">237</span>
|
||||
<span id="238">238</span>
|
||||
<span id="239">239</span>
|
||||
<span id="240">240</span>
|
||||
<span id="241">241</span>
|
||||
<span id="242">242</span>
|
||||
<span id="243">243</span>
|
||||
<span id="244">244</span>
|
||||
<span id="245">245</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">app</span>::<span class="ident">App</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">colors</span>::<span class="ident">ColorScheme</span>;
|
||||
@ -256,8 +320,57 @@
|
||||
};
|
||||
|
||||
<span class="comment">// TODO For now, blindly guess the building height</span>
|
||||
<span class="kw">let</span> <span class="ident">max_height</span> <span class="op">=</span> <span class="number">15.0</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">rng</span> <span class="op">=</span> <span class="ident">XorShiftRng</span>::<span class="ident">seed_from_u64</span>(<span class="ident">bldg</span>.<span class="ident">id</span>.<span class="number">0</span> <span class="kw">as</span> <span class="ident">u64</span>);
|
||||
<span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="ident">rng</span>.<span class="ident">gen_range</span>(<span class="number">1.0</span>, <span class="number">15.0</span>));
|
||||
<span class="kw">let</span> <span class="ident">height</span> <span class="op">=</span> <span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="ident">rng</span>.<span class="ident">gen_range</span>(<span class="number">1.0</span>, <span class="ident">max_height</span>));
|
||||
|
||||
<span class="kw">let</span> <span class="ident">map_bounds</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_gps_bounds</span>().<span class="ident">to_bounds</span>();
|
||||
<span class="kw">let</span> (<span class="ident">map_width</span>, <span class="ident">map_height</span>) <span class="op">=</span> (<span class="ident">map_bounds</span>.<span class="ident">width</span>(), <span class="ident">map_bounds</span>.<span class="ident">height</span>());
|
||||
<span class="kw">let</span> <span class="ident">map_length</span> <span class="op">=</span> <span class="ident">map_width</span>.<span class="ident">hypot</span>(<span class="ident">map_height</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">distance</span> <span class="op">=</span> <span class="op">|</span><span class="ident">pt</span>: <span class="kw-2">&</span><span class="ident">Pt2D</span><span class="op">|</span> {
|
||||
<span class="comment">// some normalization so we can compute the distance to the corner of the</span>
|
||||
<span class="comment">// screen from which the orthographic projection is based.</span>
|
||||
<span class="kw">let</span> <span class="ident">projection_origin</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">x</span> {
|
||||
<span class="ident">CameraAngle</span>::<span class="ident">IsometricNE</span> <span class="op">=</span><span class="op">></span> <span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="number">0.0</span>, <span class="ident">map_height</span>),
|
||||
<span class="ident">CameraAngle</span>::<span class="ident">IsometricNW</span> <span class="op">=</span><span class="op">></span> <span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="ident">map_width</span>, <span class="ident">map_height</span>),
|
||||
<span class="ident">CameraAngle</span>::<span class="ident">IsometricSE</span> <span class="op">=</span><span class="op">></span> <span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="number">0.0</span>, <span class="number">0.0</span>),
|
||||
<span class="ident">CameraAngle</span>::<span class="ident">IsometricSW</span> <span class="op">=</span><span class="op">></span> <span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="ident">map_width</span>, <span class="number">0.0</span>),
|
||||
<span class="ident">CameraAngle</span>::<span class="ident">TopDown</span> <span class="op">=</span><span class="op">></span> <span class="macro">unreachable</span><span class="macro">!</span>(),
|
||||
};
|
||||
|
||||
<span class="kw">let</span> <span class="ident">abs_pt</span> <span class="op">=</span> <span class="ident">Pt2D</span>::<span class="ident">new</span>(
|
||||
(<span class="ident">pt</span>.<span class="ident">x</span>() <span class="op">-</span> <span class="ident">projection_origin</span>.<span class="ident">x</span>()).<span class="ident">abs</span>(),
|
||||
(<span class="ident">pt</span>.<span class="ident">y</span>() <span class="op">-</span> <span class="ident">projection_origin</span>.<span class="ident">y</span>()).<span class="ident">abs</span>(),
|
||||
);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">a</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">hypot</span>(<span class="ident">abs_pt</span>.<span class="ident">x</span>(), <span class="ident">abs_pt</span>.<span class="ident">y</span>());
|
||||
<span class="kw">let</span> <span class="ident">theta</span> <span class="op">=</span> <span class="ident">f64</span>::<span class="ident">atan</span>(<span class="ident">abs_pt</span>.<span class="ident">y</span>() <span class="op">/</span> <span class="ident">abs_pt</span>.<span class="ident">x</span>());
|
||||
<span class="kw">let</span> <span class="ident">distance</span> <span class="op">=</span> <span class="ident">a</span> <span class="op">*</span> <span class="ident">f64</span>::<span class="ident">sin</span>(<span class="ident">theta</span> <span class="op">+</span> <span class="ident">std</span>::<span class="ident">f64</span>::<span class="ident">consts</span>::<span class="ident">PI</span> <span class="op">/</span> <span class="number">4.0</span>);
|
||||
<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="ident">distance</span>)
|
||||
};
|
||||
|
||||
<span class="comment">// Things closer to the isometric axis should appear in front of things farther</span>
|
||||
<span class="comment">// away, so we give them a higher z-index.</span>
|
||||
<span class="comment">//</span>
|
||||
<span class="comment">// Naively, we compute the entire building's distance as the distance from it's</span>
|
||||
<span class="comment">// closest point. This is simple and usually works, but will likely fail on more</span>
|
||||
<span class="comment">// complex building arrangements, e.g. if a building were tightly encircled by a</span>
|
||||
<span class="comment">// large building.</span>
|
||||
<span class="kw">let</span> <span class="ident">closest_pt</span> <span class="op">=</span> <span class="ident">bldg</span>
|
||||
.<span class="ident">polygon</span>
|
||||
.<span class="ident">points</span>()
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">min_by</span>(<span class="op">|</span><span class="ident">a</span>, <span class="ident">b</span><span class="op">|</span> <span class="ident">distance</span>(<span class="ident">a</span>).<span class="ident">cmp</span>(<span class="kw-2">&</span><span class="ident">distance</span>(<span class="ident">b</span>)));
|
||||
|
||||
<span class="kw">let</span> <span class="ident">distance_from_projection_axis</span> <span class="op">=</span> <span class="ident">closest_pt</span>
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">pt</span><span class="op">|</span> <span class="ident">distance</span>(<span class="ident">pt</span>).<span class="ident">inner_meters</span>())
|
||||
.<span class="ident">unwrap_or</span>(<span class="number">0.0</span>);
|
||||
|
||||
<span class="comment">// smaller z renders above larger</span>
|
||||
<span class="kw">let</span> <span class="ident">scale_factor</span> <span class="op">=</span> <span class="ident">map_length</span> <span class="op">+</span> <span class="ident">max_height</span>;
|
||||
<span class="kw">let</span> <span class="ident">groundfloor_z</span> <span class="op">=</span> (<span class="ident">distance_from_projection_axis</span>) <span class="op">/</span> <span class="ident">scale_factor</span> <span class="op">-</span> <span class="number">1.0</span>;
|
||||
<span class="kw">let</span> <span class="ident">roof_z</span> <span class="op">=</span> <span class="ident">groundfloor_z</span> <span class="op">-</span> <span class="ident">height</span>.<span class="ident">inner_meters</span>() <span class="op">/</span> <span class="ident">scale_factor</span>;
|
||||
|
||||
<span class="comment">// TODO Some buildings have holes in them</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">roof</span>) <span class="op">=</span> <span class="ident">Ring</span>::<span class="ident">new</span>(
|
||||
@ -271,13 +384,19 @@
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push</span>(<span class="ident">Color</span>::<span class="ident">BLACK</span>, <span class="ident">p</span>);
|
||||
}
|
||||
|
||||
<span class="comment">// In actuality, the z of the walls should start at groundfloor_z and end at</span>
|
||||
<span class="comment">// roof_z, but since we aren't dealing with actual 3d geometries, we have to</span>
|
||||
<span class="comment">// pick one value. Anecdotally, picking a value between the two seems to</span>
|
||||
<span class="comment">// usually looks right, but probably breaks down in certain overlap scenarios.</span>
|
||||
<span class="kw">let</span> <span class="ident">wall_z</span> <span class="op">=</span> (<span class="ident">groundfloor_z</span> <span class="op">+</span> <span class="ident">roof_z</span>) <span class="op">/</span> <span class="number">2.0</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">wall_beams</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> (<span class="ident">low</span>, <span class="ident">high</span>) <span class="kw">in</span> <span class="ident">bldg</span>.<span class="ident">polygon</span>.<span class="ident">points</span>().<span class="ident">iter</span>().<span class="ident">zip</span>(<span class="ident">roof</span>.<span class="ident">points</span>().<span class="ident">iter</span>()) {
|
||||
<span class="ident">wall_beams</span>.<span class="ident">push</span>(<span class="ident">Line</span>::<span class="ident">must_new</span>(<span class="kw-2">*</span><span class="ident">low</span>, <span class="kw-2">*</span><span class="ident">high</span>));
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">wall_color</span> <span class="op">=</span> <span class="ident">Color</span>::<span class="ident">hex</span>(<span class="string">"#BBBEC3"</span>);
|
||||
<span class="kw">for</span> (<span class="ident">wall1</span>, <span class="ident">wall2</span>) <span class="kw">in</span> <span class="ident">wall_beams</span>.<span class="ident">iter</span>().<span class="ident">zip</span>(<span class="ident">wall_beams</span>.<span class="ident">iter</span>().<span class="ident">skip</span>(<span class="number">1</span>)) {
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push</span>(
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push_with_z</span>(
|
||||
<span class="ident">wall_color</span>,
|
||||
<span class="ident">Ring</span>::<span class="ident">must_new</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">wall1</span>.<span class="ident">pt1</span>(),
|
||||
@ -287,14 +406,23 @@
|
||||
<span class="ident">wall1</span>.<span class="ident">pt1</span>(),
|
||||
])
|
||||
.<span class="ident">to_polygon</span>(),
|
||||
<span class="ident">wall_z</span>,
|
||||
);
|
||||
}
|
||||
<span class="kw">for</span> <span class="ident">wall</span> <span class="kw">in</span> <span class="ident">wall_beams</span> {
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push</span>(<span class="ident">Color</span>::<span class="ident">BLACK</span>, <span class="ident">wall</span>.<span class="ident">make_polygons</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">0.1</span>)));
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push_with_z</span>(
|
||||
<span class="ident">Color</span>::<span class="ident">BLACK</span>,
|
||||
<span class="ident">wall</span>.<span class="ident">make_polygons</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">0.1</span>)),
|
||||
<span class="ident">wall_z</span>,
|
||||
);
|
||||
}
|
||||
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push</span>(<span class="ident">bldg_color</span>, <span class="ident">roof</span>.<span class="ident">clone</span>().<span class="ident">to_polygon</span>());
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push</span>(<span class="ident">Color</span>::<span class="ident">BLACK</span>, <span class="ident">roof</span>.<span class="ident">to_outline</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">0.3</span>)));
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push_with_z</span>(<span class="ident">bldg_color</span>, <span class="ident">roof</span>.<span class="ident">clone</span>().<span class="ident">to_polygon</span>(), <span class="ident">roof_z</span>);
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push_with_z</span>(
|
||||
<span class="ident">Color</span>::<span class="ident">BLACK</span>,
|
||||
<span class="ident">roof</span>.<span class="ident">to_outline</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">0.3</span>)),
|
||||
<span class="ident">roof_z</span>,
|
||||
);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">bldg_batch</span>.<span class="ident">push</span>(<span class="ident">bldg_color</span>, <span class="ident">bldg</span>.<span class="ident">polygon</span>.<span class="ident">clone</span>());
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">p</span>) <span class="op">=</span> <span class="ident">bldg</span>.<span class="ident">polygon</span>.<span class="ident">to_outline</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">0.1</span>)) {
|
||||
|
@ -350,6 +350,7 @@
|
||||
<span id="350">350</span>
|
||||
<span id="351">351</span>
|
||||
<span id="352">352</span>
|
||||
<span id="353">353</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">drawing</span>::<span class="ident">Uniforms</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::{<span class="ident">Canvas</span>, <span class="ident">Color</span>, <span class="ident">GeomBatch</span>, <span class="ident">ScreenDims</span>, <span class="ident">ScreenRectangle</span>};
|
||||
@ -566,10 +567,10 @@
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">actually_upload</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">permanent</span>: <span class="ident">bool</span>, <span class="ident">batch</span>: <span class="ident">GeomBatch</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Drawable</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">vertices</span>: <span class="ident">Vec</span><span class="op"><</span>[<span class="ident">f32</span>; <span class="number">7</span>]<span class="op">></span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">vertices</span>: <span class="ident">Vec</span><span class="op"><</span>[<span class="ident">f32</span>; <span class="number">8</span>]<span class="op">></span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">indices</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
|
||||
<span class="kw">for</span> (<span class="ident">color</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="ident">batch</span>.<span class="ident">consume</span>() {
|
||||
<span class="kw">for</span> (<span class="ident">color</span>, <span class="ident">poly</span>, <span class="ident">z</span>) <span class="kw">in</span> <span class="ident">batch</span>.<span class="ident">consume</span>() {
|
||||
<span class="kw">let</span> <span class="ident">idx_offset</span> <span class="op">=</span> <span class="ident">vertices</span>.<span class="ident">len</span>() <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
<span class="kw">let</span> (<span class="ident">pts</span>, <span class="ident">raw_indices</span>) <span class="op">=</span> <span class="ident">poly</span>.<span class="ident">raw_for_rendering</span>();
|
||||
<span class="kw">for</span> <span class="ident">pt</span> <span class="kw">in</span> <span class="ident">pts</span> {
|
||||
@ -577,6 +578,7 @@
|
||||
<span class="ident">vertices</span>.<span class="ident">push</span>([
|
||||
<span class="ident">pt</span>.<span class="ident">x</span>() <span class="kw">as</span> <span class="ident">f32</span>,
|
||||
<span class="ident">pt</span>.<span class="ident">y</span>() <span class="kw">as</span> <span class="ident">f32</span>,
|
||||
<span class="ident">z</span> <span class="kw">as</span> <span class="ident">f32</span>,
|
||||
<span class="ident">style</span>[<span class="number">0</span>],
|
||||
<span class="ident">style</span>[<span class="number">1</span>],
|
||||
<span class="ident">style</span>[<span class="number">2</span>],
|
||||
@ -614,7 +616,7 @@
|
||||
);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">vertex_attributes</span>: [<span class="ident">i32</span>; <span class="number">3</span>] <span class="op">=</span> [
|
||||
<span class="number">2</span>, <span class="comment">// position is vec2</span>
|
||||
<span class="number">3</span>, <span class="comment">// position is vec2</span>
|
||||
<span class="number">4</span>, <span class="comment">// color is vec4</span>
|
||||
<span class="number">1</span>, <span class="comment">// texture_id is float</span>
|
||||
];
|
||||
|
@ -268,6 +268,11 @@
|
||||
<span id="268">268</span>
|
||||
<span id="269">269</span>
|
||||
<span id="270">270</span>
|
||||
<span id="271">271</span>
|
||||
<span id="272">272</span>
|
||||
<span id="273">273</span>
|
||||
<span id="274">274</span>
|
||||
<span id="275">275</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">assets</span>::<span class="ident">Assets</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">backend</span>::{<span class="ident">GfxCtxInnards</span>, <span class="ident">PrerenderInnards</span>};
|
||||
@ -277,10 +282,15 @@
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Bounds</span>, <span class="ident">Polygon</span>, <span class="ident">Pt2D</span>};
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cell</span>::{<span class="ident">Cell</span>, <span class="ident">RefCell</span>};
|
||||
|
||||
<span class="comment">// Lower is more on top</span>
|
||||
<span class="kw">const</span> <span class="ident">MAPSPACE_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">1.0</span>;
|
||||
<span class="kw">const</span> <span class="ident">SCREENSPACE_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">0.5</span>;
|
||||
<span class="kw">const</span> <span class="ident">TOOLTIP_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">0.0</span>;
|
||||
<span class="comment">// We organize major layers of the app with whole number z values, with lower values being more on</span>
|
||||
<span class="comment">// top.</span>
|
||||
<span class="comment">//</span>
|
||||
<span class="comment">// Within each layer, we must only adjust the z-offset of individual polygons within (-1, 0] to</span>
|
||||
<span class="comment">// avoid traversing layers.</span>
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">MAPSPACE_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">1.0</span>;
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">SCREENSPACE_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="number">0.0</span>;
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">MENU_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="op">-</span><span class="number">1.0</span>;
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const</span> <span class="ident">TOOLTIP_Z</span>: <span class="ident">f32</span> <span class="op">=</span> <span class="op">-</span><span class="number">2.0</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Uniforms</span> {
|
||||
|
@ -221,6 +221,17 @@
|
||||
<span id="221">221</span>
|
||||
<span id="222">222</span>
|
||||
<span id="223">223</span>
|
||||
<span id="224">224</span>
|
||||
<span id="225">225</span>
|
||||
<span id="226">226</span>
|
||||
<span id="227">227</span>
|
||||
<span id="228">228</span>
|
||||
<span id="229">229</span>
|
||||
<span id="230">230</span>
|
||||
<span id="231">231</span>
|
||||
<span id="232">232</span>
|
||||
<span id="233">233</span>
|
||||
<span id="234">234</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">widgets</span>::<span class="ident">button</span>::<span class="ident">BtnBuilder</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::{
|
||||
@ -231,7 +242,9 @@
|
||||
<span class="doccomment">/// A mutable builder for a group of colored polygons.</span>
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Clone</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">GeomBatch</span> {
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">list</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Fill</span>, <span class="ident">Polygon</span>)<span class="op">></span>,
|
||||
<span class="comment">// f64 is the z-value offset. This must be in (-1, 0], with values closer to -1.0</span>
|
||||
<span class="comment">// rendering above values closer to 0.0.</span>
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="ident">list</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Fill</span>, <span class="ident">Polygon</span>, <span class="ident">f64</span>)<span class="op">></span>,
|
||||
<span class="kw">pub</span> <span class="ident">autocrop_dims</span>: <span class="ident">bool</span>,
|
||||
}
|
||||
|
||||
@ -246,14 +259,23 @@
|
||||
|
||||
<span class="comment">// Adds a single polygon, painted according to `Fill`</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">push</span><span class="op"><</span><span class="ident">F</span>: <span class="ident">Into</span><span class="op"><</span><span class="ident">Fill</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">fill</span>: <span class="ident">F</span>, <span class="ident">p</span>: <span class="ident">Polygon</span>) {
|
||||
<span class="self">self</span>.<span class="ident">list</span>.<span class="ident">push</span>((<span class="ident">fill</span>.<span class="ident">into</span>(), <span class="ident">p</span>));
|
||||
<span class="self">self</span>.<span class="ident">push_with_z</span>(<span class="ident">fill</span>, <span class="ident">p</span>, <span class="number">0.0</span>);
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Offset z value to render above/below other polygons.</span>
|
||||
<span class="doccomment">/// z must be in (-1, 0] to ensure we don't traverse layers of the UI - to make</span>
|
||||
<span class="doccomment">/// sure we don't inadvertently render something *above* a tooltip, etc.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">push_with_z</span><span class="op"><</span><span class="ident">F</span>: <span class="ident">Into</span><span class="op"><</span><span class="ident">Fill</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">fill</span>: <span class="ident">F</span>, <span class="ident">p</span>: <span class="ident">Polygon</span>, <span class="ident">z_offset</span>: <span class="ident">f64</span>) {
|
||||
<span class="macro">debug_assert</span><span class="macro">!</span>(<span class="ident">z_offset</span> <span class="op">></span> <span class="op">-</span><span class="number">1.0</span>);
|
||||
<span class="macro">debug_assert</span><span class="macro">!</span>(<span class="ident">z_offset</span> <span class="op"><</span><span class="op">=</span> <span class="number">0.0</span>);
|
||||
<span class="self">self</span>.<span class="ident">list</span>.<span class="ident">push</span>((<span class="ident">fill</span>.<span class="ident">into</span>(), <span class="ident">p</span>, <span class="ident">z_offset</span>));
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Applies one Fill to many polygons.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">extend</span><span class="op"><</span><span class="ident">F</span>: <span class="ident">Into</span><span class="op"><</span><span class="ident">Fill</span><span class="op">></span><span class="op">></span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">fill</span>: <span class="ident">F</span>, <span class="ident">polys</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Polygon</span><span class="op">></span>) {
|
||||
<span class="kw">let</span> <span class="ident">fill</span> <span class="op">=</span> <span class="ident">fill</span>.<span class="ident">into</span>();
|
||||
<span class="kw">for</span> <span class="ident">p</span> <span class="kw">in</span> <span class="ident">polys</span> {
|
||||
<span class="self">self</span>.<span class="ident">list</span>.<span class="ident">push</span>((<span class="ident">fill</span>.<span class="ident">clone</span>(), <span class="ident">p</span>));
|
||||
<span class="self">self</span>.<span class="ident">list</span>.<span class="ident">push</span>((<span class="ident">fill</span>.<span class="ident">clone</span>(), <span class="ident">p</span>, <span class="number">0.0</span>));
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,7 +285,7 @@
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Returns the colored polygons in this batch, destroying the batch.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">consume</span>(<span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Fill</span>, <span class="ident">Polygon</span>)<span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">consume</span>(<span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">Fill</span>, <span class="ident">Polygon</span>, <span class="ident">f64</span>)<span class="op">></span> {
|
||||
<span class="self">self</span>.<span class="ident">list</span>
|
||||
}
|
||||
|
||||
@ -296,7 +318,7 @@
|
||||
<span class="doccomment">/// Compute the bounds of all polygons in this batch.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_bounds</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Bounds</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">bounds</span> <span class="op">=</span> <span class="ident">Bounds</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="ident">bounds</span>.<span class="ident">union</span>(<span class="ident">poly</span>.<span class="ident">get_bounds</span>());
|
||||
}
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">autocrop_dims</span> {
|
||||
@ -311,7 +333,7 @@
|
||||
<span class="kw">if</span> <span class="ident">bounds</span>.<span class="ident">min_x</span> <span class="op">=</span><span class="op">=</span> <span class="number">0.0</span> <span class="kw-2">&</span><span class="op">&</span> <span class="ident">bounds</span>.<span class="ident">min_y</span> <span class="op">=</span><span class="op">=</span> <span class="number">0.0</span> {
|
||||
<span class="kw">return</span> <span class="self">self</span>;
|
||||
}
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw-2">*</span><span class="ident">poly</span> <span class="op">=</span> <span class="ident">poly</span>.<span class="ident">translate</span>(<span class="op">-</span><span class="ident">bounds</span>.<span class="ident">min_x</span>, <span class="op">-</span><span class="ident">bounds</span>.<span class="ident">min_y</span>);
|
||||
}
|
||||
<span class="self">self</span>
|
||||
@ -320,7 +342,7 @@
|
||||
<span class="doccomment">/// Builds a single polygon covering everything in this batch. Use to create a hitbox.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">unioned_polygon</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Polygon</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">list</span>[<span class="number">0</span>].<span class="number">1</span>.<span class="ident">clone</span>();
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">p</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">list</span>[<span class="number">1</span>..] {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">p</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">list</span>[<span class="number">1</span>..] {
|
||||
<span class="ident">result</span> <span class="op">=</span> <span class="ident">result</span>.<span class="ident">union</span>(<span class="ident">p</span>.<span class="ident">clone</span>());
|
||||
}
|
||||
<span class="ident">result</span>
|
||||
@ -357,7 +379,7 @@
|
||||
|
||||
<span class="doccomment">/// Transforms all colors in a batch.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">color</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">transformation</span>: <span class="ident">RewriteColor</span>) <span class="op">-</span><span class="op">></span> <span class="ident">GeomBatch</span> {
|
||||
<span class="kw">for</span> (<span class="ident">fancy</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="ident">fancy</span>, <span class="kw">_</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">Fill</span>::<span class="ident">Color</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">c</span>) <span class="op">=</span> <span class="ident">fancy</span> {
|
||||
<span class="kw-2">*</span><span class="ident">c</span> <span class="op">=</span> <span class="ident">transformation</span>.<span class="ident">apply</span>(<span class="kw-2">*</span><span class="ident">c</span>);
|
||||
}
|
||||
@ -375,7 +397,7 @@
|
||||
|
||||
<span class="doccomment">/// Translates the batch by some offset.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">translate</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">dx</span>: <span class="ident">f64</span>, <span class="ident">dy</span>: <span class="ident">f64</span>) <span class="op">-</span><span class="op">></span> <span class="ident">GeomBatch</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw-2">*</span><span class="ident">poly</span> <span class="op">=</span> <span class="ident">poly</span>.<span class="ident">translate</span>(<span class="ident">dx</span>, <span class="ident">dy</span>);
|
||||
}
|
||||
<span class="self">self</span>
|
||||
@ -383,7 +405,7 @@
|
||||
|
||||
<span class="doccomment">/// Rotates each polygon in the batch relative to the center of that polygon.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">rotate</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">angle</span>: <span class="ident">Angle</span>) <span class="op">-</span><span class="op">></span> <span class="ident">GeomBatch</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw-2">*</span><span class="ident">poly</span> <span class="op">=</span> <span class="ident">poly</span>.<span class="ident">rotate</span>(<span class="ident">angle</span>);
|
||||
}
|
||||
<span class="self">self</span>
|
||||
@ -392,7 +414,7 @@
|
||||
<span class="doccomment">/// Rotates each polygon in the batch relative to the center of the entire batch.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">rotate_around_batch_center</span>(<span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">angle</span>: <span class="ident">Angle</span>) <span class="op">-</span><span class="op">></span> <span class="ident">GeomBatch</span> {
|
||||
<span class="kw">let</span> <span class="ident">center</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_bounds</span>().<span class="ident">center</span>();
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw-2">*</span><span class="ident">poly</span> <span class="op">=</span> <span class="ident">poly</span>.<span class="ident">rotate_around</span>(<span class="ident">angle</span>, <span class="ident">center</span>);
|
||||
}
|
||||
<span class="self">self</span>
|
||||
@ -403,7 +425,7 @@
|
||||
<span class="kw">if</span> <span class="ident">factor</span> <span class="op">=</span><span class="op">=</span> <span class="number">1.0</span> {
|
||||
<span class="kw">return</span> <span class="self">self</span>;
|
||||
}
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">poly</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">list</span> {
|
||||
<span class="comment">// strip_rings first -- sometimes when scaling down, the original rings collapse. Since</span>
|
||||
<span class="comment">// this polygon is part of a GeomBatch anyway, not calling to_outline on it.</span>
|
||||
<span class="kw-2">*</span><span class="ident">poly</span> <span class="op">=</span> <span class="ident">poly</span>.<span class="ident">strip_rings</span>().<span class="ident">scale</span>(<span class="ident">factor</span>);
|
||||
@ -416,7 +438,7 @@
|
||||
<span class="doccomment">/// Creates a batch of filled polygons.</span>
|
||||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">list</span>: <span class="ident">Vec</span><span class="op"><</span>(<span class="ident">F</span>, <span class="ident">Polygon</span>)<span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">GeomBatch</span> {
|
||||
<span class="ident">GeomBatch</span> {
|
||||
<span class="ident">list</span>: <span class="ident">list</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">c</span>, <span class="ident">p</span>)<span class="op">|</span> (<span class="ident">c</span>.<span class="ident">into</span>(), <span class="ident">p</span>)).<span class="ident">collect</span>(),
|
||||
<span class="ident">list</span>: <span class="ident">list</span>.<span class="ident">into_iter</span>().<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">c</span>, <span class="ident">p</span>)<span class="op">|</span> (<span class="ident">c</span>.<span class="ident">into</span>(), <span class="ident">p</span>, <span class="number">0.0</span>)).<span class="ident">collect</span>(),
|
||||
<span class="ident">autocrop_dims</span>: <span class="bool-val">true</span>,
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,6 @@
|
||||
<span id="181">181</span>
|
||||
<span id="182">182</span>
|
||||
<span id="183">183</span>
|
||||
<span id="184">184</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::{
|
||||
<span class="ident">Btn</span>, <span class="ident">Button</span>, <span class="ident">Choice</span>, <span class="ident">Color</span>, <span class="ident">EventCtx</span>, <span class="ident">GeomBatch</span>, <span class="ident">GfxCtx</span>, <span class="ident">Menu</span>, <span class="ident">Outcome</span>, <span class="ident">ScreenDims</span>, <span class="ident">ScreenPt</span>,
|
||||
@ -331,8 +330,7 @@
|
||||
<span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="number">0.0</span>, <span class="number">0.0</span>),
|
||||
<span class="ident">ScreenPt</span>::<span class="ident">new</span>(<span class="ident">m</span>.<span class="ident">top_left</span>.<span class="ident">x</span> <span class="op">-</span> <span class="ident">pad</span>, <span class="ident">m</span>.<span class="ident">top_left</span>.<span class="ident">y</span> <span class="op">-</span> <span class="ident">pad</span>),
|
||||
<span class="number">1.0</span>,
|
||||
<span class="comment">// Between SCREENSPACE_Z and TOOLTIP_Z</span>
|
||||
<span class="prelude-val">Some</span>(<span class="number">0.1</span>),
|
||||
<span class="prelude-val">Some</span>(<span class="kw">crate</span>::<span class="ident">drawing</span>::<span class="ident">MENU_Z</span>),
|
||||
);
|
||||
<span class="ident">g</span>.<span class="ident">redraw</span>(<span class="kw-2">&</span><span class="ident">draw_bg</span>);
|
||||
<span class="ident">g</span>.<span class="ident">unfork</span>();
|
||||
|
@ -186,6 +186,10 @@
|
||||
<span id="186">186</span>
|
||||
<span id="187">187</span>
|
||||
<span id="188">188</span>
|
||||
<span id="189">189</span>
|
||||
<span id="190">190</span>
|
||||
<span id="191">191</span>
|
||||
<span id="192">192</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::{
|
||||
<span class="ident">text</span>, <span class="ident">Choice</span>, <span class="ident">EventCtx</span>, <span class="ident">GfxCtx</span>, <span class="ident">Key</span>, <span class="ident">Line</span>, <span class="ident">Outcome</span>, <span class="ident">ScreenDims</span>, <span class="ident">ScreenPt</span>, <span class="ident">ScreenRectangle</span>,
|
||||
@ -349,8 +353,12 @@
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">draw</span> <span class="op">=</span> <span class="ident">g</span>.<span class="ident">upload</span>(<span class="self">self</span>.<span class="ident">calculate_txt</span>(<span class="ident">g</span>.<span class="ident">style</span>()).<span class="ident">render_g</span>(<span class="ident">g</span>));
|
||||
<span class="comment">// In between tooltip and normal screenspace</span>
|
||||
<span class="ident">g</span>.<span class="ident">fork</span>(<span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="number">0.0</span>, <span class="number">0.0</span>), <span class="self">self</span>.<span class="ident">top_left</span>, <span class="number">1.0</span>, <span class="prelude-val">Some</span>(<span class="number">0.1</span>));
|
||||
<span class="ident">g</span>.<span class="ident">fork</span>(
|
||||
<span class="ident">Pt2D</span>::<span class="ident">new</span>(<span class="number">0.0</span>, <span class="number">0.0</span>),
|
||||
<span class="self">self</span>.<span class="ident">top_left</span>,
|
||||
<span class="number">1.0</span>,
|
||||
<span class="prelude-val">Some</span>(<span class="kw">crate</span>::<span class="ident">drawing</span>::<span class="ident">MENU_Z</span>),
|
||||
);
|
||||
<span class="ident">g</span>.<span class="ident">redraw</span>(<span class="kw-2">&</span><span class="ident">draw</span>);
|
||||
<span class="ident">g</span>.<span class="ident">unfork</span>();
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `backend_glow` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, backend_glow"><title>widgetry::backend_glow - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module backend_glow</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>widgetry</a></p><script>window.sidebarCurrent = {name: 'backend_glow', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/backend_glow.rs.html#1-352' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>widgetry</a>::<wbr><a class="mod" href=''>backend_glow</a></span></h1><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `backend_glow` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, backend_glow"><title>widgetry::backend_glow - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module backend_glow</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#structs">Structs</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>widgetry</a></p><script>window.sidebarCurrent = {name: 'backend_glow', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/backend_glow.rs.html#1-353' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>widgetry</a>::<wbr><a class="mod" href=''>backend_glow</a></span></h1><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
||||
<table><tr><td><code>pub use crate::backend_glow_native::<a class="fn" href="../../widgetry/backend_glow_native/fn.setup.html" title="fn widgetry::backend_glow_native::setup">setup</a>;</code></td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.Buffer.html" title='widgetry::backend_glow::Buffer struct'>Buffer</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Drawable.html" title='widgetry::backend_glow::Drawable struct'>Drawable</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.GfxCtxInnards.html" title='widgetry::backend_glow::GfxCtxInnards struct'>GfxCtxInnards</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.PrerenderInnards.html" title='widgetry::backend_glow::PrerenderInnards struct'>PrerenderInnards</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.VertexArray.html" title='widgetry::backend_glow::VertexArray struct'>VertexArray</a></td><td class='docblock-short'></td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
|
||||
<table><tr class='module-item'><td><a class="type" href="type.WindowAdapter.html" title='widgetry::backend_glow::WindowAdapter type'>WindowAdapter</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MAPSPACE_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, MAPSPACE_Z"><title>widgetry::drawing::MAPSPACE_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'MAPSPACE_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#10' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>MAPSPACE_Z</a></span></h1><pre class='rust const'>const MAPSPACE_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = 1.0;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MAPSPACE_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, MAPSPACE_Z"><title>widgetry::drawing::MAPSPACE_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'MAPSPACE_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#14' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>MAPSPACE_Z</a></span></h1><pre class='rust const'>pub(crate) const MAPSPACE_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = 1.0;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
1
rustdoc/widgetry/drawing/constant.MENU_Z.html
Normal file
1
rustdoc/widgetry/drawing/constant.MENU_Z.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `MENU_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, MENU_Z"><title>widgetry::drawing::MENU_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'MENU_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#16' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>MENU_Z</a></span></h1><pre class='rust const'>pub(crate) const MENU_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = -1.0;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SCREENSPACE_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, SCREENSPACE_Z"><title>widgetry::drawing::SCREENSPACE_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'SCREENSPACE_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#11' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>SCREENSPACE_Z</a></span></h1><pre class='rust const'>const SCREENSPACE_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = 0.5;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SCREENSPACE_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, SCREENSPACE_Z"><title>widgetry::drawing::SCREENSPACE_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'SCREENSPACE_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#15' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>SCREENSPACE_Z</a></span></h1><pre class='rust const'>pub(crate) const SCREENSPACE_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = 0.0;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TOOLTIP_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, TOOLTIP_Z"><title>widgetry::drawing::TOOLTIP_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'TOOLTIP_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#12' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>TOOLTIP_Z</a></span></h1><pre class='rust const'>const TOOLTIP_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = 0.0;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `TOOLTIP_Z` constant in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, TOOLTIP_Z"><title>widgetry::drawing::TOOLTIP_Z - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'TOOLTIP_Z', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#17' title='goto source code'>[src]</a></span><span class='in-band'>Constant <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="constant" href=''>TOOLTIP_Z</a></span></h1><pre class='rust const'>pub(crate) const TOOLTIP_Z: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a> = -2.0;</pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1,3 +1,3 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `drawing` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, drawing"><title>widgetry::drawing - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module drawing</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class='location'><a href='../index.html'>widgetry</a></p><script>window.sidebarCurrent = {name: 'drawing', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#1-270' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>widgetry</a>::<wbr><a class="mod" href=''>drawing</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `drawing` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, drawing"><title>widgetry::drawing - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module drawing</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class='location'><a href='../index.html'>widgetry</a></p><script>window.sidebarCurrent = {name: 'drawing', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#1-275' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>widgetry</a>::<wbr><a class="mod" href=''>drawing</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.GfxCtx.html" title='widgetry::drawing::GfxCtx struct'>GfxCtx</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Prerender.html" title='widgetry::drawing::Prerender struct'>Prerender</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Uniforms.html" title='widgetry::drawing::Uniforms struct'>Uniforms</a></td><td class='docblock-short'></td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
|
||||
<table><tr class='module-item'><td><a class="constant" href="constant.MAPSPACE_Z.html" title='widgetry::drawing::MAPSPACE_Z constant'>MAPSPACE_Z</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.SCREENSPACE_Z.html" title='widgetry::drawing::SCREENSPACE_Z constant'>SCREENSPACE_Z</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.TOOLTIP_Z.html" title='widgetry::drawing::TOOLTIP_Z constant'>TOOLTIP_Z</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
||||
<table><tr class='module-item'><td><a class="constant" href="constant.MAPSPACE_Z.html" title='widgetry::drawing::MAPSPACE_Z constant'>MAPSPACE_Z</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.MENU_Z.html" title='widgetry::drawing::MENU_Z constant'>MENU_Z</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.SCREENSPACE_Z.html" title='widgetry::drawing::SCREENSPACE_Z constant'>SCREENSPACE_Z</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.TOOLTIP_Z.html" title='widgetry::drawing::TOOLTIP_Z constant'>TOOLTIP_Z</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1 +1 @@
|
||||
initSidebarItems({"constant":[["MAPSPACE_Z",""],["SCREENSPACE_Z",""],["TOOLTIP_Z",""]],"struct":[["GfxCtx",""],["Prerender",""],["Uniforms",""]]});
|
||||
initSidebarItems({"constant":[["MAPSPACE_Z",""],["MENU_Z",""],["SCREENSPACE_Z",""],["TOOLTIP_Z",""]],"struct":[["GfxCtx",""],["Prerender",""],["Uniforms",""]]});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Uniforms` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Uniforms"><title>widgetry::drawing::Uniforms - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Uniforms</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.transform">transform</a><a href="#structfield.window">window</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'Uniforms', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#15-20' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="struct" href=''>Uniforms</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Uniforms {
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Uniforms` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Uniforms"><title>widgetry::drawing::Uniforms - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct Uniforms</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.transform">transform</a><a href="#structfield.window">window</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class='location'><a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a></p><script>window.sidebarCurrent = {name: 'Uniforms', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/drawing.rs.html#20-25' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>widgetry</a>::<wbr><a href='index.html'>drawing</a>::<wbr><a class="struct" href=''>Uniforms</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct Uniforms {
|
||||
pub transform: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 3]</a>,
|
||||
pub window: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 3]</a>,
|
||||
}</pre></div><h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.transform" class="structfield small-section-header"><a href="#structfield.transform" class="anchor field"></a><code>transform: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 3]</a></code></span><span id="structfield.window" class="structfield small-section-header"><a href="#structfield.window" class="anchor field"></a><code>window: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 3]</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/widgetry/drawing.rs.html#22-37' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(canvas: &<a class="struct" href="../../widgetry/struct.Canvas.html" title="struct widgetry::Canvas">Canvas</a>) -> <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a class='srclink' href='../../src/widgetry/drawing.rs.html#23-36' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/widgetry/drawing.rs.html#14' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/widgetry/drawing.rs.html#14' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.transform" class="structfield small-section-header"><a href="#structfield.transform" class="anchor field"></a><code>transform: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 3]</a></code></span><span id="structfield.window" class="structfield small-section-header"><a href="#structfield.window" class="anchor field"></a><code>window: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f32.html">f32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 3]</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/widgetry/drawing.rs.html#27-42' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(canvas: &<a class="struct" href="../../widgetry/struct.Canvas.html" title="struct widgetry::Canvas">Canvas</a>) -> <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a class='srclink' href='../../src/widgetry/drawing.rs.html#28-41' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/widgetry/drawing.rs.html#19' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/widgetry/drawing.rs.html#19' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../widgetry/drawing/struct.Uniforms.html" title="struct widgetry::drawing::Uniforms">Uniforms</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-217' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-216' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220-224' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221-223' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `geom` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, geom"><title>widgetry::geom - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module geom</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../index.html'>widgetry</a></p><script>window.sidebarCurrent = {name: 'geom', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/geom.rs.html#1-223' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>widgetry</a>::<wbr><a class="mod" href=''>geom</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `geom` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, geom"><title>widgetry::geom - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../widgetry/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module geom</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../index.html'>widgetry</a></p><script>window.sidebarCurrent = {name: 'geom', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/widgetry/geom.rs.html#1-234' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>widgetry</a>::<wbr><a class="mod" href=''>geom</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.GeomBatch.html" title='widgetry::geom::GeomBatch struct'>GeomBatch</a></td><td class='docblock-short'><p>A mutable builder for a group of colored polygons.</p>
|
||||
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||||
<table><tr class='module-item'><td><a class="enum" href="enum.RewriteColor.html" title='widgetry::geom::RewriteColor enum'>RewriteColor</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "widgetry";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,10 +4,10 @@
|
||||
pub(crate) top_left: <a class="struct" href="../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a>,
|
||||
dims: <a class="struct" href="../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a>,
|
||||
}</pre></div><h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.choices" class="structfield small-section-header"><a href="#structfield.choices" class="anchor field"></a><code>choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>></code></span><span id="structfield.current_idx" class="structfield small-section-header"><a href="#structfield.current_idx" class="anchor field"></a><code>current_idx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span id="structfield.top_left" class="structfield small-section-header"><a href="#structfield.top_left" class="anchor field"></a><code>top_left: <a class="struct" href="../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a></code></span><span id="structfield.dims" class="structfield small-section-header"><a href="#structfield.dims" class="anchor field"></a><code>dims: <a class="struct" href="../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<T: 'static> <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#15-68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(ctx: &<a class="struct" href="../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>>) -> <a class="struct" href="../widgetry/struct.Widget.html" title="struct widgetry::Widget">Widget</a></code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#16-26' title='goto source code'>[src]</a></h4><h4 id='method.take_current_choice' class="method"><code>pub fn <a href='#method.take_current_choice' class='fnname'>take_current_choice</a>(&mut self) -> T</code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#28-31' title='goto source code'>[src]</a></h4><h4 id='method.calculate_txt' class="method"><code>fn <a href='#method.calculate_txt' class='fnname'>calculate_txt</a>(&self, style: &<a class="struct" href="../widgetry/struct.Style.html" title="struct widgetry::Style">Style</a>) -> <a class="struct" href="../widgetry/struct.Text.html" title="struct widgetry::Text">Text</a></code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#33-67' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-WidgetImpl' class='impl'><code class='in-band'>impl<T: 'static> <a class="trait" href="../widgetry/widgets/trait.WidgetImpl.html" title="trait widgetry::widgets::WidgetImpl">WidgetImpl</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl-WidgetImpl' class='anchor'></a><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#70-188' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_dims' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims' class='fnname'>get_dims</a>(&self) -> <a class="struct" href="../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#71-73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>What width and height does the widget occupy? If this changes, be sure to set <code>redo_layout</code> to true in <code>event</code>. <a href="../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims">Read more</a></p>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.choices" class="structfield small-section-header"><a href="#structfield.choices" class="anchor field"></a><code>choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>></code></span><span id="structfield.current_idx" class="structfield small-section-header"><a href="#structfield.current_idx" class="anchor field"></a><code>current_idx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span id="structfield.top_left" class="structfield small-section-header"><a href="#structfield.top_left" class="anchor field"></a><code>top_left: <a class="struct" href="../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a></code></span><span id="structfield.dims" class="structfield small-section-header"><a href="#structfield.dims" class="anchor field"></a><code>dims: <a class="struct" href="../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<T: 'static> <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#15-68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(ctx: &<a class="struct" href="../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>>) -> <a class="struct" href="../widgetry/struct.Widget.html" title="struct widgetry::Widget">Widget</a></code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#16-26' title='goto source code'>[src]</a></h4><h4 id='method.take_current_choice' class="method"><code>pub fn <a href='#method.take_current_choice' class='fnname'>take_current_choice</a>(&mut self) -> T</code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#28-31' title='goto source code'>[src]</a></h4><h4 id='method.calculate_txt' class="method"><code>fn <a href='#method.calculate_txt' class='fnname'>calculate_txt</a>(&self, style: &<a class="struct" href="../widgetry/struct.Style.html" title="struct widgetry::Style">Style</a>) -> <a class="struct" href="../widgetry/struct.Text.html" title="struct widgetry::Text">Text</a></code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#33-67' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-WidgetImpl' class='impl'><code class='in-band'>impl<T: 'static> <a class="trait" href="../widgetry/widgets/trait.WidgetImpl.html" title="trait widgetry::widgets::WidgetImpl">WidgetImpl</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl-WidgetImpl' class='anchor'></a><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#70-192' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_dims' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims' class='fnname'>get_dims</a>(&self) -> <a class="struct" href="../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#71-73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>What width and height does the widget occupy? If this changes, be sure to set <code>redo_layout</code> to true in <code>event</code>. <a href="../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims">Read more</a></p>
|
||||
</div><h4 id='method.set_pos' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#tymethod.set_pos' class='fnname'>set_pos</a>(&mut self, top_left: <a class="struct" href="../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a>)</code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#75-77' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Your widget's top left corner should be here. Handle mouse events and draw appropriately.</p>
|
||||
</div><h4 id='method.event' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#tymethod.event' class='fnname'>event</a>(&mut self, ctx: &mut <a class="struct" href="../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, output: &mut <a class="struct" href="../widgetry/struct.WidgetOutput.html" title="struct widgetry::WidgetOutput">WidgetOutput</a>)</code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#79-155' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Your chance to react to an event. Any side effects outside of this widget are communicated through the output. <a href="../widgetry/widgets/trait.WidgetImpl.html#tymethod.event">Read more</a></p>
|
||||
</div><h4 id='method.draw' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#tymethod.draw' class='fnname'>draw</a>(&self, g: &mut <a class="struct" href="../widgetry/struct.GfxCtx.html" title="struct widgetry::GfxCtx">GfxCtx</a>)</code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#157-187' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Draw the widget. Be sure to draw relative to the top-left specified by <code>set_pos</code>.</p>
|
||||
</div><h4 id='method.draw' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#tymethod.draw' class='fnname'>draw</a>(&self, g: &mut <a class="struct" href="../widgetry/struct.GfxCtx.html" title="struct widgetry::GfxCtx">GfxCtx</a>)</code><a class='srclink' href='../src/widgetry/widgets/menu.rs.html#157-191' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Draw the widget. Be sure to draw relative to the top-left specified by <code>set_pos</code>.</p>
|
||||
</div><h4 id='method.can_restore' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#method.can_restore' class='fnname'>can_restore</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../src/widgetry/widgets/mod.rs.html#49-51' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>If a new Panel is being created to replace an older one, all widgets have the chance to preserve state from the previous version. <a href="../widgetry/widgets/trait.WidgetImpl.html#method.can_restore">Read more</a></p>
|
||||
</div><h4 id='method.restore' class="method hidden"><code>fn <a href='../widgetry/widgets/trait.WidgetImpl.html#method.restore' class='fnname'>restore</a>(&mut self, _: &mut <a class="struct" href="../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, _prev: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../widgetry/widgets/trait.WidgetImpl.html" title="trait widgetry::widgets::WidgetImpl">WidgetImpl</a>>)</code><a class='srclink' href='../src/widgetry/widgets/mod.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Restore state from the previous version of this widget, with the same ID. Implementors must downcast. <a href="../widgetry/widgets/trait.WidgetImpl.html#method.restore">Read more</a></p>
|
||||
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `make_btn` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, make_btn"><title>widgetry::widgets::dropdown::make_btn - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../widgetry/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a href='index.html'>dropdown</a></p><script>window.sidebarCurrent = {name: 'make_btn', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/widgetry/widgets/dropdown.rs.html#176-184' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a href='index.html'>dropdown</a>::<wbr><a class="fn" href=''>make_btn</a></span></h1><pre class='rust fn'>fn make_btn(<br> ctx: &<a class="struct" href="../../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, <br> name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> label: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> blank_btn_label: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="../../../widgetry/widgets/button/struct.Button.html" title="struct widgetry::widgets::button::Button">Button</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "widgetry";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `make_btn` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, make_btn"><title>widgetry::widgets::dropdown::make_btn - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../widgetry/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class='location'><a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a href='index.html'>dropdown</a></p><script>window.sidebarCurrent = {name: 'make_btn', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/widgetry/widgets/dropdown.rs.html#175-183' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a href='index.html'>dropdown</a>::<wbr><a class="fn" href=''>make_btn</a></span></h1><pre class='rust fn'>fn make_btn(<br> ctx: &<a class="struct" href="../../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, <br> name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> label: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> blank_btn_label: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="struct" href="../../../widgetry/widgets/button/struct.Button.html" title="struct widgetry::widgets::button::Button">Button</a></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "widgetry";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,3 +1,3 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `dropdown` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, dropdown"><title>widgetry::widgets::dropdown - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../widgetry/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module dropdown</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a></p><script>window.sidebarCurrent = {name: 'dropdown', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/widgetry/widgets/dropdown.rs.html#1-184' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a class="mod" href=''>dropdown</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `dropdown` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, dropdown"><title>widgetry::widgets::dropdown - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../widgetry/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module dropdown</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a></p><script>window.sidebarCurrent = {name: 'dropdown', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/widgetry/widgets/dropdown.rs.html#1-183' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a class="mod" href=''>dropdown</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.Dropdown.html" title='widgetry::widgets::dropdown::Dropdown struct'>Dropdown</a></td><td class='docblock-short'></td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||||
<table><tr class='module-item'><td><a class="fn" href="fn.make_btn.html" title='widgetry::widgets::dropdown::make_btn fn'>make_btn</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "widgetry";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `menu` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, menu"><title>widgetry::widgets::menu - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../widgetry/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module menu</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a></p><script>window.sidebarCurrent = {name: 'menu', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#1-188' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a class="mod" href=''>menu</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `menu` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, menu"><title>widgetry::widgets::menu - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../widgetry/index.html'><div class='logo-container'><img src='../../../rust-logo.png' alt='logo'></div></a><p class='location'>Module menu</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'><a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a></p><script>window.sidebarCurrent = {name: 'menu', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#1-192' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>widgetry</a>::<wbr><a href='../index.html'>widgets</a>::<wbr><a class="mod" href=''>menu</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table><tr class='module-item'><td><a class="struct" href="struct.Menu.html" title='widgetry::widgets::menu::Menu struct'>Menu</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "widgetry";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -4,10 +4,10 @@
|
||||
pub(crate) top_left: <a class="struct" href="../../../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a>,
|
||||
dims: <a class="struct" href="../../../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a>,
|
||||
}</pre></div><h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.choices" class="structfield small-section-header"><a href="#structfield.choices" class="anchor field"></a><code>choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>></code></span><span id="structfield.current_idx" class="structfield small-section-header"><a href="#structfield.current_idx" class="anchor field"></a><code>current_idx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span id="structfield.top_left" class="structfield small-section-header"><a href="#structfield.top_left" class="anchor field"></a><code>top_left: <a class="struct" href="../../../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a></code></span><span id="structfield.dims" class="structfield small-section-header"><a href="#structfield.dims" class="anchor field"></a><code>dims: <a class="struct" href="../../../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<T: 'static> <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#15-68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(ctx: &<a class="struct" href="../../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>>) -> <a class="struct" href="../../../widgetry/struct.Widget.html" title="struct widgetry::Widget">Widget</a></code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#16-26' title='goto source code'>[src]</a></h4><h4 id='method.take_current_choice' class="method"><code>pub fn <a href='#method.take_current_choice' class='fnname'>take_current_choice</a>(&mut self) -> T</code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#28-31' title='goto source code'>[src]</a></h4><h4 id='method.calculate_txt' class="method"><code>fn <a href='#method.calculate_txt' class='fnname'>calculate_txt</a>(&self, style: &<a class="struct" href="../../../widgetry/struct.Style.html" title="struct widgetry::Style">Style</a>) -> <a class="struct" href="../../../widgetry/struct.Text.html" title="struct widgetry::Text">Text</a></code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#33-67' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-WidgetImpl' class='impl'><code class='in-band'>impl<T: 'static> <a class="trait" href="../../../widgetry/widgets/trait.WidgetImpl.html" title="trait widgetry::widgets::WidgetImpl">WidgetImpl</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl-WidgetImpl' class='anchor'></a><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#70-188' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_dims' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims' class='fnname'>get_dims</a>(&self) -> <a class="struct" href="../../../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#71-73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>What width and height does the widget occupy? If this changes, be sure to set <code>redo_layout</code> to true in <code>event</code>. <a href="../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims">Read more</a></p>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.choices" class="structfield small-section-header"><a href="#structfield.choices" class="anchor field"></a><code>choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>></code></span><span id="structfield.current_idx" class="structfield small-section-header"><a href="#structfield.current_idx" class="anchor field"></a><code>current_idx: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span id="structfield.top_left" class="structfield small-section-header"><a href="#structfield.top_left" class="anchor field"></a><code>top_left: <a class="struct" href="../../../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a></code></span><span id="structfield.dims" class="structfield small-section-header"><a href="#structfield.dims" class="anchor field"></a><code>dims: <a class="struct" href="../../../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code></span><h2 id='implementations' class='small-section-header'>Implementations<a href='#implementations' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl<T: 'static> <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#15-68' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.new' class="method"><code>pub fn <a href='#method.new' class='fnname'>new</a>(ctx: &<a class="struct" href="../../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, choices: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../../../widgetry/struct.Choice.html" title="struct widgetry::Choice">Choice</a><T>>) -> <a class="struct" href="../../../widgetry/struct.Widget.html" title="struct widgetry::Widget">Widget</a></code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#16-26' title='goto source code'>[src]</a></h4><h4 id='method.take_current_choice' class="method"><code>pub fn <a href='#method.take_current_choice' class='fnname'>take_current_choice</a>(&mut self) -> T</code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#28-31' title='goto source code'>[src]</a></h4><h4 id='method.calculate_txt' class="method"><code>fn <a href='#method.calculate_txt' class='fnname'>calculate_txt</a>(&self, style: &<a class="struct" href="../../../widgetry/struct.Style.html" title="struct widgetry::Style">Style</a>) -> <a class="struct" href="../../../widgetry/struct.Text.html" title="struct widgetry::Text">Text</a></code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#33-67' title='goto source code'>[src]</a></h4></div><h2 id='trait-implementations' class='small-section-header'>Trait Implementations<a href='#trait-implementations' class='anchor'></a></h2><div id='trait-implementations-list'><h3 id='impl-WidgetImpl' class='impl'><code class='in-band'>impl<T: 'static> <a class="trait" href="../../../widgetry/widgets/trait.WidgetImpl.html" title="trait widgetry::widgets::WidgetImpl">WidgetImpl</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T></code><a href='#impl-WidgetImpl' class='anchor'></a><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#70-192' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.get_dims' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims' class='fnname'>get_dims</a>(&self) -> <a class="struct" href="../../../widgetry/struct.ScreenDims.html" title="struct widgetry::ScreenDims">ScreenDims</a></code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#71-73' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>What width and height does the widget occupy? If this changes, be sure to set <code>redo_layout</code> to true in <code>event</code>. <a href="../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.get_dims">Read more</a></p>
|
||||
</div><h4 id='method.set_pos' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.set_pos' class='fnname'>set_pos</a>(&mut self, top_left: <a class="struct" href="../../../widgetry/struct.ScreenPt.html" title="struct widgetry::ScreenPt">ScreenPt</a>)</code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#75-77' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Your widget's top left corner should be here. Handle mouse events and draw appropriately.</p>
|
||||
</div><h4 id='method.event' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.event' class='fnname'>event</a>(&mut self, ctx: &mut <a class="struct" href="../../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, output: &mut <a class="struct" href="../../../widgetry/struct.WidgetOutput.html" title="struct widgetry::WidgetOutput">WidgetOutput</a>)</code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#79-155' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Your chance to react to an event. Any side effects outside of this widget are communicated through the output. <a href="../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.event">Read more</a></p>
|
||||
</div><h4 id='method.draw' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.draw' class='fnname'>draw</a>(&self, g: &mut <a class="struct" href="../../../widgetry/struct.GfxCtx.html" title="struct widgetry::GfxCtx">GfxCtx</a>)</code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#157-187' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Draw the widget. Be sure to draw relative to the top-left specified by <code>set_pos</code>.</p>
|
||||
</div><h4 id='method.draw' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#tymethod.draw' class='fnname'>draw</a>(&self, g: &mut <a class="struct" href="../../../widgetry/struct.GfxCtx.html" title="struct widgetry::GfxCtx">GfxCtx</a>)</code><a class='srclink' href='../../../src/widgetry/widgets/menu.rs.html#157-191' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Draw the widget. Be sure to draw relative to the top-left specified by <code>set_pos</code>.</p>
|
||||
</div><h4 id='method.can_restore' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#method.can_restore' class='fnname'>can_restore</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../../src/widgetry/widgets/mod.rs.html#49-51' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>If a new Panel is being created to replace an older one, all widgets have the chance to preserve state from the previous version. <a href="../../../widgetry/widgets/trait.WidgetImpl.html#method.can_restore">Read more</a></p>
|
||||
</div><h4 id='method.restore' class="method hidden"><code>fn <a href='../../../widgetry/widgets/trait.WidgetImpl.html#method.restore' class='fnname'>restore</a>(&mut self, _: &mut <a class="struct" href="../../../widgetry/struct.EventCtx.html" title="struct widgetry::EventCtx">EventCtx</a>, _prev: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../../widgetry/widgets/trait.WidgetImpl.html" title="trait widgetry::widgets::WidgetImpl">WidgetImpl</a>>)</code><a class='srclink' href='../../../src/widgetry/widgets/mod.rs.html#54-56' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Restore state from the previous version of this widget, with the same ID. Implementors must downcast. <a href="../../../widgetry/widgets/trait.WidgetImpl.html#method.restore">Read more</a></p>
|
||||
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a>, </span></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>, </span></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../widgetry/struct.Menu.html" title="struct widgetry::Menu">Menu</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Any' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user