1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<html><head><title>theme.roundrect - Ren'Py Visual Novel Engine</title><link href="../../shared.css" rel="stylesheet"><link href="../../monobook.css" rel="stylesheet"><link href="../../common.css" rel="stylesheet"><link href="../../monobook2.css" rel="stylesheet"><link href="../../docs.css" rel="stylesheet" /></link></link></link></link></head><body><div id="bodyContent">
<p class="docnav"><a href="../../index.html">documentation index</a> ◦ <a href="../Reference_Manual.html">reference manual</a> ◦ <a href="../Function_Index.html">function index</a></p><p><a id="theme.roundrect" name="theme.roundrect"></a></p>
<h1><span class="mw-headline">theme.roundrect</span></h1>
<div class="thumb tright">
<div class="thumbinner" style="width:182px;"><a class="image" href="/wiki/File:roundrect.png.html" title="roundrect.png"><img alt="" border="0" class="thumbimage" height="135" src="../../images/180px-roundrect.png" width="180" /></a>
<div class="thumbcaption">
</div>
</div>
</div>
<p><span id="theme.roundrect" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b><strong class="selflink">theme.roundrect</strong></b></td>
<td valign="top">(widget="#003c78", widget_hover="#0050a0", widget_text="#c8e1ff", widget_selected="#ffffc8", disabled="#404040", disabled_text="#c8c8c8", label=,"#ffffff" frame="#6496c8", window="#000000c0", text_size=None, small_text_size=None, mm_root=..., gm_root=..., less_rounded=False):</td>
</tr>
</table>
<div class="renpy-doc">
<p>This enables the use of the roundrect theme. By default, this theme styles the game in a blue color scheme. However, by supplying one or more of the parameters given below, the color scheme can be changed.</p>
<p><i>widget</i> - The background color of non-focued buttons and sliders.</p>
<p><i>widget_hover</i> - The background color of focused buttons and sliders.</p>
<p><i>widget_text</i> - The text color of non-selected buttons.</p>
<p><i>widget_selected</i> - The text color of selected buttons.</p>
<p><i>disabled</i> - The background color of disabled buttons.</p>
<p><i>disabled_text</i> - The text color of disabled buttons.</p>
<p><i>label</i> - The text color of non-selected labels.</p>
<p><i>frame</i> - The background color of frames.</p>
<p><i>mm_root</i> - A displayable (such as an Image or Solid) that will be used as the background for the main menu.</p>
<p><i>gm_root</i> - A displayable (such as an Image or Solid) that will be used as the background for the game menu.</p>
<p><i>less_rounded</i> - If True, causes the buttons to appear less rounded in 800x600 mode (has no effect in 640x480 mode).</p>
<p><i>text_size</i> - The size of text, such as button captions, labels, and prompts. Defaults to 18 if the screen is 640 pixels wide or less, and 22 otherwise.</p>
<p><i>small_text_size</i> - The size of the text on large buttons. Defaults to 12 if the screen is 640 pixels wide or less, and 16 otherwise.</p>
<p><i>widget</i>, <i>widget_hover</i>, <i>disabled</i>, and <i>frame</i> may either be single colors, or tuples containing two colors. In the latter case, a vertical gradient is used.</p>
<a id="Component_functions" name="Component_functions"></a>
<h3><span class="mw-headline">Component functions</span></h3>
<p>The following functions exist to allow you to add elements of the roundrect theme to another theme. The other theme must have been set up before these functions can be used. Arguments are as for roundrect, except that all must be specified (no defaulting occurs).</p>
<ul>
<li><b>theme.roundrect_labels</b>(text_size, label)</li>
<li><b>theme.roundrect_frames</b>(less_rounded, frame)</li>
<li><b>theme.roundrect_buttons</b>(text_size, less_rounded, widget, widget_hover, widget_text, widget_selected, disabled, disabled_text)</li>
<li><b>theme.roundrect_large_buttons</b>(text_size, less_rounded, widget, widget_hover, widget_text, widget_selected, disabled, disabled_text)</li>
<li><b>theme.roundrect_prompts</b>(text_size, label)</li>
<li><b>theme.roundrect_bars</b>(widget, widget_hover)</li>
</ul>
</div>
<p><br clear="both" /></p>
<p><a id="Example" name="Example"></a></p>
<h2><span class="mw-headline">Example</span></h2>
<p>This code usually lives in options.rpy.</p>
<pre>
<span class="kwa">init</span> <span class="sym">-</span><span class="num">1</span><span class="sym">:</span>
<span class="kwa">python hide</span><span class="sym">:</span>
theme<span class="sym">.</span><span class="kwd">roundrect</span><span class="sym">(</span>
<span class="slc">## The color of an idle widget face.</span>
widget <span class="sym">= (</span><span class="str">"#005c98"</span><span class="sym">,</span> <span class="str">"#003c78"</span><span class="sym">),</span>
<span class="slc">## The color of a focused widget face.</span>
widget_hover <span class="sym">= (</span><span class="str">"#0070c0"</span><span class="sym">,</span> <span class="str">"#0050a0"</span><span class="sym">),</span>
<span class="slc">## The color of the text in a widget.</span>
widget_text <span class="sym">=</span> <span class="str">"#c8ffff"</span><span class="sym">,</span>
<span class="slc">## The color of the text in a selected widget. (For</span>
<span class="slc">## example, the current value of a preference.)</span>
widget_selected <span class="sym">=</span> <span class="str">"#ffffc8"</span><span class="sym">,</span>
<span class="slc">## The color of a disabled widget face.</span>
disabled <span class="sym">= (</span><span class="str">"#606060"</span><span class="sym">,</span> <span class="str">"#404040"</span><span class="sym">),</span>
<span class="slc">## The color of disabled widget text.</span>
disabled_text <span class="sym">=</span> <span class="str">"#c8c8c8"</span><span class="sym">,</span>
<span class="slc">## The color of informational labels.</span>
<span class="kwa">label</span> <span class="sym">=</span> <span class="str">"#ffffff"</span><span class="sym">,</span>
<span class="slc">## The color of a frame containing widgets.</span>
frame <span class="sym">=</span> <span class="str">"#6496c8"</span><span class="sym">,</span>
<span class="slc">## The background of the main menu. This can be a color</span>
<span class="slc">## beginning with '#', or an image filename. The latter</span>
<span class="slc">## should take up the full height and width of the screen.</span>
mm_root <span class="sym">=</span> <span class="str">"mainmenu.jpg"</span><span class="sym">,</span>
<span class="slc">## The background of the game menu. This can be a color</span>
<span class="slc">## beginning with '#', or an image filename. The latter</span>
<span class="slc">## should take up the full height and width of the screen.</span>
gm_root <span class="sym">=</span> <span class="str">"#dcebff"</span><span class="sym">,</span>
<span class="slc">## And we're done with the theme. The theme will customize</span>
<span class="slc">## various styles, so if we want to change them, we should</span>
<span class="slc">## do so below.</span>
<span class="sym">)</span>
</pre>
<p><br /></p>
<div class="visualClear" />
<hr /><p class="docnav"><a href="../../index.html">documentation index</a> ◦ <a href="../Reference_Manual.html">reference manual</a> ◦ <a href="../Function_Index.html">function index</a></p></div>
</body></html>
|