mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +03:00
deploy: f5eca6ff02
This commit is contained in:
parent
786fcf7ff1
commit
02a2d0002e
@ -1,5 +1,5 @@
|
||||
<!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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><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 rust-logo'><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!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
|
||||
<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-a95c4551e63dceca/out/built.rs.html#53" 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> = "Thu, 11 Mar 2021 00:45:37 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<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-a95c4551e63dceca/out/built.rs.html#53" 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> = "Thu, 11 Mar 2021 17:56:36 +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>
|
@ -122,7 +122,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.50.0 (cb75ad5db 2021-02-10)"</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">"Thu, 11 Mar 2021 00:45:37 +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">"Thu, 11 Mar 2021 17:56:36 +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>
|
||||
|
@ -407,6 +407,11 @@
|
||||
<span id="404">404</span>
|
||||
<span id="405">405</span>
|
||||
<span id="406">406</span>
|
||||
<span id="407">407</span>
|
||||
<span id="408">408</span>
|
||||
<span id="409">409</span>
|
||||
<span id="410">410</span>
|
||||
<span id="411">411</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cell</span>::<span class="ident">Cell</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">panic</span>;
|
||||
@ -471,6 +476,11 @@
|
||||
<span class="comment">// Update some widgetry state that's stashed in Canvas for sad reasons.</span>
|
||||
{
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">Event</span>::<span class="ident">WindowResized</span>(<span class="ident">new_size</span>) <span class="op">=</span> <span class="ident">input</span>.<span class="ident">event</span> {
|
||||
<span class="comment">// On platforms like Linux, new_size jumps around when the window is first created.</span>
|
||||
<span class="comment">// As a result, if an app has loading screens at startup and doesn't process all of</span>
|
||||
<span class="comment">// these events, new_size may be stuck at an incorrect value during the loading.</span>
|
||||
<span class="comment">//</span>
|
||||
<span class="comment">// Instead, just use inner_size; it appears correct on all platforms tested.</span>
|
||||
<span class="kw">let</span> <span class="ident">inner_size</span> <span class="op">=</span> <span class="ident">prerender</span>.<span class="ident">window_size</span>();
|
||||
<span class="macro">trace</span><span class="macro">!</span>(
|
||||
<span class="string">"winit event says the window was resized from {}, {} to {:?}. But inner size \
|
||||
@ -480,7 +490,7 @@
|
||||
<span class="ident">new_size</span>,
|
||||
<span class="ident">inner_size</span>
|
||||
);
|
||||
<span class="ident">prerender</span>.<span class="ident">window_resized</span>(<span class="ident">new_size</span>);
|
||||
<span class="ident">prerender</span>.<span class="ident">window_resized</span>(<span class="ident">inner_size</span>);
|
||||
<span class="self">self</span>.<span class="ident">canvas</span>.<span class="ident">window_width</span> <span class="op">=</span> <span class="ident">inner_size</span>.<span class="ident">width</span>;
|
||||
<span class="self">self</span>.<span class="ident">canvas</span>.<span class="ident">window_height</span> <span class="op">=</span> <span class="ident">inner_size</span>.<span class="ident">height</span>;
|
||||
}
|
||||
|
@ -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 `run` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, run"><title>widgetry::run - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="index.html">widgetry</a></p><script>window.sidebarCurrent = {name: "run", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
|
||||
<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/runner.rs.html#238-406" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">widgetry</a>::<wbr><a class="fn" href="">run</a></span></h1><pre class="rust fn">pub fn run<A: 'static + <a class="trait" href="../widgetry/app_state/trait.SharedAppState.html" title="trait widgetry::app_state::SharedAppState">SharedAppState</a>, F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut <a class="struct" href="../widgetry/event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, <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="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../widgetry/app_state/trait.State.html" title="trait widgetry::app_state::State">State</a><A>>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>(<br> settings: <a class="struct" href="../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a>, <br> make_app: F<br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.never.html">!</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>
|
||||
<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/runner.rs.html#243-411" title="goto source code">[src]</a></span><span class="in-band">Function <a href="index.html">widgetry</a>::<wbr><a class="fn" href="">run</a></span></h1><pre class="rust fn">pub fn run<A: 'static + <a class="trait" href="../widgetry/app_state/trait.SharedAppState.html" title="trait widgetry::app_state::SharedAppState">SharedAppState</a>, F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut <a class="struct" href="../widgetry/event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, <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="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../widgetry/app_state/trait.State.html" title="trait widgetry::app_state::State">State</a><A>>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>(<br> settings: <a class="struct" href="../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a>, <br> make_app: F<br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.never.html">!</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,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 `run` fn in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, run"><title>widgetry::runner::run - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><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">runner</a></p><script>window.sidebarCurrent = {name: "run", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
|
||||
<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/runner.rs.html#238-406" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">runner</a>::<wbr><a class="fn" href="">run</a></span></h1><pre class="rust fn">pub fn run<A: 'static + <a class="trait" href="../../widgetry/app_state/trait.SharedAppState.html" title="trait widgetry::app_state::SharedAppState">SharedAppState</a>, F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut <a class="struct" href="../../widgetry/event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, <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="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../widgetry/app_state/trait.State.html" title="trait widgetry::app_state::State">State</a><A>>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>(<br> settings: <a class="struct" href="../../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a>, <br> make_app: F<br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.never.html">!</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>
|
||||
<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/runner.rs.html#243-411" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">widgetry</a>::<wbr><a href="index.html">runner</a>::<wbr><a class="fn" href="">run</a></span></h1><pre class="rust fn">pub fn run<A: 'static + <a class="trait" href="../../widgetry/app_state/trait.SharedAppState.html" title="trait widgetry::app_state::SharedAppState">SharedAppState</a>, F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut <a class="struct" href="../../widgetry/event_ctx/struct.EventCtx.html" title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>A, <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="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../widgetry/app_state/trait.State.html" title="trait widgetry::app_state::State">State</a><A>>><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>(<br> settings: <a class="struct" href="../../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a>, <br> make_app: F<br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.never.html">!</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,7 +1,7 @@
|
||||
<!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 `runner` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, runner"><title>widgetry::runner - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module runner</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../index.html">widgetry</a></p><script>window.sidebarCurrent = {name: "runner", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
|
||||
<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/runner.rs.html#1-406" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">widgetry</a>::<wbr><a class="mod" href="">runner</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<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/runner.rs.html#1-411" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">widgetry</a>::<wbr><a class="mod" href="">runner</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.Settings.html" title="widgetry::runner::Settings struct">Settings</a></td><td class="docblock-short"><p>Customize how widgetry works. These settings can't be changed after starting.</p>
|
||||
</td></tr><tr class="module-item"><td><a class="struct" href="struct.State.html" title="widgetry::runner::State struct">State</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.DEBUG_PERFORMANCE.html" title="widgetry::runner::DEBUG_PERFORMANCE constant">DEBUG_PERFORMANCE</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="constant" href="constant.UPDATE_FREQUENCY.html" title="widgetry::runner::UPDATE_FREQUENCY constant">UPDATE_FREQUENCY</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!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 `Settings` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Settings"><title>widgetry::runner::Settings - 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="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><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 rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Settings</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.dump_raw_events">dump_raw_events</a><a href="#structfield.loading_tips">loading_tips</a><a href="#structfield.read_svg">read_svg</a><a href="#structfield.require_minimum_width">require_minimum_width</a><a href="#structfield.scale_factor">scale_factor</a><a href="#structfield.window_icon">window_icon</a><a href="#structfield.window_title">window_title</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.dump_raw_events">dump_raw_events</a><a href="#method.loading_tips">loading_tips</a><a href="#method.new">new</a><a href="#method.read_svg">read_svg</a><a href="#method.require_minimum_width">require_minimum_width</a><a href="#method.scale_factor">scale_factor</a><a href="#method.window_icon">window_icon</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-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="../index.html">widgetry</a>::<wbr><a href="index.html">runner</a></p><script>window.sidebarCurrent = {name: "Settings", 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!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
|
||||
<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/runner.rs.html#158-166" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">runner</a>::<wbr><a class="struct" href="">Settings</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Settings {
|
||||
<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/runner.rs.html#163-171" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">widgetry</a>::<wbr><a href="index.html">runner</a>::<wbr><a class="struct" href="">Settings</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Settings {
|
||||
window_title: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
dump_raw_events: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
||||
scale_factor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>>,
|
||||
@ -11,19 +11,19 @@
|
||||
read_svg: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>,
|
||||
}</pre></div><div class="docblock"><p>Customize how widgetry works. These settings can't be changed after starting.</p>
|
||||
</div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.window_title" class="structfield small-section-header"><a href="#structfield.window_title" class="anchor field"></a><code>window_title: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><span id="structfield.dump_raw_events" class="structfield small-section-header"><a href="#structfield.dump_raw_events" class="anchor field"></a><code>dump_raw_events: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span id="structfield.scale_factor" class="structfield small-section-header"><a href="#structfield.scale_factor" class="anchor field"></a><code>scale_factor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.require_minimum_width" class="structfield small-section-header"><a href="#structfield.require_minimum_width" class="anchor field"></a><code>require_minimum_width: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.window_icon" class="structfield small-section-header"><a href="#structfield.window_icon" class="anchor field"></a><code>window_icon: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><span id="structfield.loading_tips" class="structfield small-section-header"><a href="#structfield.loading_tips" class="anchor field"></a><code>loading_tips: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>></code></span><span id="structfield.read_svg" class="structfield small-section-header"><a href="#structfield.read_svg" class="anchor field"></a><code>read_svg: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</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/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/runner.rs.html#168-236" 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>(window_title: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="../../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a class="srclink" href="../../src/widgetry/runner.rs.html#170-188" title="goto source code">[src]</a></h4><div class="docblock"><p>Specify the title of the window to open.</p>
|
||||
</div><h4 id="method.dump_raw_events" class="method"><code>pub fn <a href="#method.dump_raw_events" class="fnname">dump_raw_events</a>(self) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#191-195" title="goto source code">[src]</a></h4><div class="docblock"><p>Log every raw winit event to the DEBUG level.</p>
|
||||
</div><h4 id="method.scale_factor" class="method"><code>pub fn <a href="#method.scale_factor" class="fnname">scale_factor</a>(self, scale_factor: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#198-201" title="goto source code">[src]</a></h4><div class="docblock"><p>Override the initial HiDPI scale factor from whatever winit initially detects.</p>
|
||||
</div><h4 id="method.require_minimum_width" class="method"><code>pub fn <a href="#method.require_minimum_width" class="fnname">require_minimum_width</a>(self, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#209-212" title="goto source code">[src]</a></h4><div class="docblock"><p>If the screen width using the monitor's detected scale factor is below this value (in units
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.window_title" class="structfield small-section-header"><a href="#structfield.window_title" class="anchor field"></a><code>window_title: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><span id="structfield.dump_raw_events" class="structfield small-section-header"><a href="#structfield.dump_raw_events" class="anchor field"></a><code>dump_raw_events: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span id="structfield.scale_factor" class="structfield small-section-header"><a href="#structfield.scale_factor" class="anchor field"></a><code>scale_factor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.require_minimum_width" class="structfield small-section-header"><a href="#structfield.require_minimum_width" class="anchor field"></a><code>require_minimum_width: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.window_icon" class="structfield small-section-header"><a href="#structfield.window_icon" class="anchor field"></a><code>window_icon: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><span id="structfield.loading_tips" class="structfield small-section-header"><a href="#structfield.loading_tips" class="anchor field"></a><code>loading_tips: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>></code></span><span id="structfield.read_svg" class="structfield small-section-header"><a href="#structfield.read_svg" class="anchor field"></a><code>read_svg: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</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/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/runner.rs.html#173-241" 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>(window_title: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="../../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a class="srclink" href="../../src/widgetry/runner.rs.html#175-193" title="goto source code">[src]</a></h4><div class="docblock"><p>Specify the title of the window to open.</p>
|
||||
</div><h4 id="method.dump_raw_events" class="method"><code>pub fn <a href="#method.dump_raw_events" class="fnname">dump_raw_events</a>(self) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#196-200" title="goto source code">[src]</a></h4><div class="docblock"><p>Log every raw winit event to the DEBUG level.</p>
|
||||
</div><h4 id="method.scale_factor" class="method"><code>pub fn <a href="#method.scale_factor" class="fnname">scale_factor</a>(self, scale_factor: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#203-206" title="goto source code">[src]</a></h4><div class="docblock"><p>Override the initial HiDPI scale factor from whatever winit initially detects.</p>
|
||||
</div><h4 id="method.require_minimum_width" class="method"><code>pub fn <a href="#method.require_minimum_width" class="fnname">require_minimum_width</a>(self, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#214-217" title="goto source code">[src]</a></h4><div class="docblock"><p>If the screen width using the monitor's detected scale factor is below this value (in units
|
||||
of logical pixels, not physical), then force the scale factor to be 1. If <code>scale_factor()</code>
|
||||
has been called, always use that override. This is helpful for users with HiDPI displays at
|
||||
low resolutions, for applications designed for screens with some minimum width. Scaling
|
||||
down UI elements isn't ideal (since it doesn't respect the user's device settings), but
|
||||
having panels overlap is worse.</p>
|
||||
</div><h4 id="method.window_icon" class="method"><code>pub fn <a href="#method.window_icon" class="fnname">window_icon</a>(self, path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#215-218" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the window icon. This should be a 32x32 image.</p>
|
||||
</div><h4 id="method.loading_tips" class="method"><code>pub fn <a href="#method.loading_tips" class="fnname">loading_tips</a>(self, txt: <a class="struct" href="../../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#222-225" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the text that'll appear during long <code>ctx.loading_screen</code> calls. You can use this as a
|
||||
</div><h4 id="method.window_icon" class="method"><code>pub fn <a href="#method.window_icon" class="fnname">window_icon</a>(self, path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#220-223" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the window icon. This should be a 32x32 image.</p>
|
||||
</div><h4 id="method.loading_tips" class="method"><code>pub fn <a href="#method.loading_tips" class="fnname">loading_tips</a>(self, txt: <a class="struct" href="../../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#227-230" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the text that'll appear during long <code>ctx.loading_screen</code> calls. You can use this as a
|
||||
way to entertain your users while they're waiting.</p>
|
||||
</div><h4 id="method.read_svg" class="method"><code>pub fn <a href="#method.read_svg" class="fnname">read_svg</a>(self, function: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#232-235" title="goto source code">[src]</a></h4><div class="docblock"><p>When calling <code>Widget::draw_svg</code>, <code>ButtonBuilder::image_path</code>, and similar, use this function
|
||||
</div><h4 id="method.read_svg" class="method"><code>pub fn <a href="#method.read_svg" class="fnname">read_svg</a>(self, function: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>) -> Self</code><a class="srclink" href="../../src/widgetry/runner.rs.html#237-240" title="goto source code">[src]</a></h4><div class="docblock"><p>When calling <code>Widget::draw_svg</code>, <code>ButtonBuilder::image_path</code>, and similar, use this function
|
||||
to transform the filename given to the raw bytes of that SVG file. By default, this just
|
||||
reads the file normally. You may want to override this to more conveniently locate the
|
||||
file (transforming a short filename to a full path) or to handle reading files in WASM
|
||||
|
@ -6,7 +6,7 @@
|
||||
pub(crate) canvas: <a class="struct" href="../../widgetry/canvas/struct.Canvas.html" title="struct widgetry::canvas::Canvas">Canvas</a>,
|
||||
style: <a class="struct" href="../../widgetry/style/struct.Style.html" title="struct widgetry::style::Style">Style</a>,
|
||||
}</pre></div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.app" class="structfield small-section-header"><a href="#structfield.app" class="anchor field"></a><code>app: <a class="struct" href="../../widgetry/app_state/struct.App.html" title="struct widgetry::app_state::App">App</a><A></code></span><span id="structfield.canvas" class="structfield small-section-header"><a href="#structfield.canvas" class="anchor field"></a><code>canvas: <a class="struct" href="../../widgetry/canvas/struct.Canvas.html" title="struct widgetry::canvas::Canvas">Canvas</a></code></span><span id="structfield.style" class="structfield small-section-header"><a href="#structfield.style" class="anchor field"></a><code>style: <a class="struct" href="../../widgetry/style/struct.Style.html" title="struct widgetry::style::Style">Style</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: <a class="trait" href="../../widgetry/app_state/trait.SharedAppState.html" title="trait widgetry::app_state::SharedAppState">SharedAppState</a>> <a class="struct" href="../../widgetry/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/runner.rs.html#29-155" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ev: <a class="enum" href="../../widgetry/event/enum.Event.html" title="enum widgetry::event::Event">Event</a>, prerender: &<a class="struct" href="../../widgetry/drawing/struct.Prerender.html" title="struct widgetry::drawing::Prerender">Prerender</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="../../widgetry/event_ctx/enum.UpdateType.html" title="enum widgetry::event_ctx::UpdateType">UpdateType</a>>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/widgetry/runner.rs.html#31-125" title="goto source code">[src]</a></h4><h4 id="method.draw" class="method"><code>pub(crate) fn <a href="#method.draw" class="fnname">draw</a>(<br> &mut self, <br> prerender: &<a class="struct" href="../../widgetry/drawing/struct.Prerender.html" title="struct widgetry::drawing::Prerender">Prerender</a>, <br> screenshot: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code><a class="srclink" href="../../src/widgetry/runner.rs.html#128-154" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns naming hint. Logically consumes the number of uploads.</p>
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.app" class="structfield small-section-header"><a href="#structfield.app" class="anchor field"></a><code>app: <a class="struct" href="../../widgetry/app_state/struct.App.html" title="struct widgetry::app_state::App">App</a><A></code></span><span id="structfield.canvas" class="structfield small-section-header"><a href="#structfield.canvas" class="anchor field"></a><code>canvas: <a class="struct" href="../../widgetry/canvas/struct.Canvas.html" title="struct widgetry::canvas::Canvas">Canvas</a></code></span><span id="structfield.style" class="structfield small-section-header"><a href="#structfield.style" class="anchor field"></a><code>style: <a class="struct" href="../../widgetry/style/struct.Style.html" title="struct widgetry::style::Style">Style</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: <a class="trait" href="../../widgetry/app_state/trait.SharedAppState.html" title="trait widgetry::app_state::SharedAppState">SharedAppState</a>> <a class="struct" href="../../widgetry/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/widgetry/runner.rs.html#29-160" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ev: <a class="enum" href="../../widgetry/event/enum.Event.html" title="enum widgetry::event::Event">Event</a>, prerender: &<a class="struct" href="../../widgetry/drawing/struct.Prerender.html" title="struct widgetry::drawing::Prerender">Prerender</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="enum" href="../../widgetry/event_ctx/enum.UpdateType.html" title="enum widgetry::event_ctx::UpdateType">UpdateType</a>>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><a class="srclink" href="../../src/widgetry/runner.rs.html#31-130" title="goto source code">[src]</a></h4><h4 id="method.draw" class="method"><code>pub(crate) fn <a href="#method.draw" class="fnname">draw</a>(<br> &mut self, <br> prerender: &<a class="struct" href="../../widgetry/drawing/struct.Prerender.html" title="struct widgetry::drawing::Prerender">Prerender</a>, <br> screenshot: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code><a class="srclink" href="../../src/widgetry/runner.rs.html#133-159" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns naming hint. Logically consumes the number of uploads.</p>
|
||||
</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> !<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/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/widgetry/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<A> !<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/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/widgetry/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<A> !<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/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/widgetry/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<A> <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/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A> <span class="where fmt-newline">where<br> A: <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><a class="srclink" href="../../src/widgetry/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<A> !<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/runner/struct.State.html" title="struct widgetry::runner::State">State</a><A></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/widgetry/lib.rs.html#1" title="goto source code">[src]</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>pub 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#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub 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#211-213" 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#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub 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#218-220" 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>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!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 `Settings` struct in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, Settings"><title>widgetry::Settings - 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="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings"></script><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><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 rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class="location">Struct Settings</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.dump_raw_events">dump_raw_events</a><a href="#structfield.loading_tips">loading_tips</a><a href="#structfield.read_svg">read_svg</a><a href="#structfield.require_minimum_width">require_minimum_width</a><a href="#structfield.scale_factor">scale_factor</a><a href="#structfield.window_icon">window_icon</a><a href="#structfield.window_title">window_title</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.dump_raw_events">dump_raw_events</a><a href="#method.loading_tips">loading_tips</a><a href="#method.new">new</a><a href="#method.read_svg">read_svg</a><a href="#method.require_minimum_width">require_minimum_width</a><a href="#method.scale_factor">scale_factor</a><a href="#method.window_icon">window_icon</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-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="index.html">widgetry</a></p><script>window.sidebarCurrent = {name: "Settings", 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!" aria-haspopup="menu"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></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><button type="button" class="help-button">?</button>
|
||||
<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/runner.rs.html#158-166" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">widgetry</a>::<wbr><a class="struct" href="">Settings</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Settings {
|
||||
<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/runner.rs.html#163-171" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="index.html">widgetry</a>::<wbr><a class="struct" href="">Settings</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Settings {
|
||||
window_title: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
|
||||
dump_raw_events: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>,
|
||||
scale_factor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>>,
|
||||
@ -11,19 +11,19 @@
|
||||
read_svg: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>,
|
||||
}</pre></div><div class="docblock"><p>Customize how widgetry works. These settings can't be changed after starting.</p>
|
||||
</div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.window_title" class="structfield small-section-header"><a href="#structfield.window_title" class="anchor field"></a><code>window_title: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><span id="structfield.dump_raw_events" class="structfield small-section-header"><a href="#structfield.dump_raw_events" class="anchor field"></a><code>dump_raw_events: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span id="structfield.scale_factor" class="structfield small-section-header"><a href="#structfield.scale_factor" class="anchor field"></a><code>scale_factor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.require_minimum_width" class="structfield small-section-header"><a href="#structfield.require_minimum_width" class="anchor field"></a><code>require_minimum_width: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.window_icon" class="structfield small-section-header"><a href="#structfield.window_icon" class="anchor field"></a><code>window_icon: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><span id="structfield.loading_tips" class="structfield small-section-header"><a href="#structfield.loading_tips" class="anchor field"></a><code>loading_tips: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>></code></span><span id="structfield.read_svg" class="structfield small-section-header"><a href="#structfield.read_svg" class="anchor field"></a><code>read_svg: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</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/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/widgetry/runner.rs.html#168-236" 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>(window_title: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a class="srclink" href="../src/widgetry/runner.rs.html#170-188" title="goto source code">[src]</a></h4><div class="docblock"><p>Specify the title of the window to open.</p>
|
||||
</div><h4 id="method.dump_raw_events" class="method"><code>pub fn <a href="#method.dump_raw_events" class="fnname">dump_raw_events</a>(self) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#191-195" title="goto source code">[src]</a></h4><div class="docblock"><p>Log every raw winit event to the DEBUG level.</p>
|
||||
</div><h4 id="method.scale_factor" class="method"><code>pub fn <a href="#method.scale_factor" class="fnname">scale_factor</a>(self, scale_factor: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#198-201" title="goto source code">[src]</a></h4><div class="docblock"><p>Override the initial HiDPI scale factor from whatever winit initially detects.</p>
|
||||
</div><h4 id="method.require_minimum_width" class="method"><code>pub fn <a href="#method.require_minimum_width" class="fnname">require_minimum_width</a>(self, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#209-212" title="goto source code">[src]</a></h4><div class="docblock"><p>If the screen width using the monitor's detected scale factor is below this value (in units
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.window_title" class="structfield small-section-header"><a href="#structfield.window_title" class="anchor field"></a><code>window_title: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></span><span id="structfield.dump_raw_events" class="structfield small-section-header"><a href="#structfield.dump_raw_events" class="anchor field"></a><code>dump_raw_events: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span><span id="structfield.scale_factor" class="structfield small-section-header"><a href="#structfield.scale_factor" class="anchor field"></a><code>scale_factor: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.require_minimum_width" class="structfield small-section-header"><a href="#structfield.require_minimum_width" class="anchor field"></a><code>require_minimum_width: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>></code></span><span id="structfield.window_icon" class="structfield small-section-header"><a href="#structfield.window_icon" class="anchor field"></a><code>window_icon: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></code></span><span id="structfield.loading_tips" class="structfield small-section-header"><a href="#structfield.loading_tips" class="anchor field"></a><code>loading_tips: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>></code></span><span id="structfield.read_svg" class="structfield small-section-header"><a href="#structfield.read_svg" class="anchor field"></a><code>read_svg: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</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/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../src/widgetry/runner.rs.html#173-241" 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>(window_title: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="../widgetry/runner/struct.Settings.html" title="struct widgetry::runner::Settings">Settings</a></code><a class="srclink" href="../src/widgetry/runner.rs.html#175-193" title="goto source code">[src]</a></h4><div class="docblock"><p>Specify the title of the window to open.</p>
|
||||
</div><h4 id="method.dump_raw_events" class="method"><code>pub fn <a href="#method.dump_raw_events" class="fnname">dump_raw_events</a>(self) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#196-200" title="goto source code">[src]</a></h4><div class="docblock"><p>Log every raw winit event to the DEBUG level.</p>
|
||||
</div><h4 id="method.scale_factor" class="method"><code>pub fn <a href="#method.scale_factor" class="fnname">scale_factor</a>(self, scale_factor: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#203-206" title="goto source code">[src]</a></h4><div class="docblock"><p>Override the initial HiDPI scale factor from whatever winit initially detects.</p>
|
||||
</div><h4 id="method.require_minimum_width" class="method"><code>pub fn <a href="#method.require_minimum_width" class="fnname">require_minimum_width</a>(self, width: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#214-217" title="goto source code">[src]</a></h4><div class="docblock"><p>If the screen width using the monitor's detected scale factor is below this value (in units
|
||||
of logical pixels, not physical), then force the scale factor to be 1. If <code>scale_factor()</code>
|
||||
has been called, always use that override. This is helpful for users with HiDPI displays at
|
||||
low resolutions, for applications designed for screens with some minimum width. Scaling
|
||||
down UI elements isn't ideal (since it doesn't respect the user's device settings), but
|
||||
having panels overlap is worse.</p>
|
||||
</div><h4 id="method.window_icon" class="method"><code>pub fn <a href="#method.window_icon" class="fnname">window_icon</a>(self, path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#215-218" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the window icon. This should be a 32x32 image.</p>
|
||||
</div><h4 id="method.loading_tips" class="method"><code>pub fn <a href="#method.loading_tips" class="fnname">loading_tips</a>(self, txt: <a class="struct" href="../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#222-225" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the text that'll appear during long <code>ctx.loading_screen</code> calls. You can use this as a
|
||||
</div><h4 id="method.window_icon" class="method"><code>pub fn <a href="#method.window_icon" class="fnname">window_icon</a>(self, path: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#220-223" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the window icon. This should be a 32x32 image.</p>
|
||||
</div><h4 id="method.loading_tips" class="method"><code>pub fn <a href="#method.loading_tips" class="fnname">loading_tips</a>(self, txt: <a class="struct" href="../widgetry/text/struct.Text.html" title="struct widgetry::text::Text">Text</a>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#227-230" title="goto source code">[src]</a></h4><div class="docblock"><p>Sets the text that'll appear during long <code>ctx.loading_screen</code> calls. You can use this as a
|
||||
way to entertain your users while they're waiting.</p>
|
||||
</div><h4 id="method.read_svg" class="method"><code>pub fn <a href="#method.read_svg" class="fnname">read_svg</a>(self, function: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#232-235" title="goto source code">[src]</a></h4><div class="docblock"><p>When calling <code>Widget::draw_svg</code>, <code>ButtonBuilder::image_path</code>, and similar, use this function
|
||||
</div><h4 id="method.read_svg" class="method"><code>pub fn <a href="#method.read_svg" class="fnname">read_svg</a>(self, function: <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="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>>) -> Self</code><a class="srclink" href="../src/widgetry/runner.rs.html#237-240" title="goto source code">[src]</a></h4><div class="docblock"><p>When calling <code>Widget::draw_svg</code>, <code>ButtonBuilder::image_path</code>, and similar, use this function
|
||||
to transform the filename given to the raw bytes of that SVG file. By default, this just
|
||||
reads the file normally. You may want to override this to more conveniently locate the
|
||||
file (transforming a short filename to a full path) or to handle reading files in WASM
|
||||
|
Loading…
Reference in New Issue
Block a user