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
|
<html><head><title>theme.image buttons - 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.image_buttons" name="theme.image_buttons"></a></p>
<h1><span class="mw-headline">theme.image_buttons</span></h1>
<p>This function provides a way to automatically convert textbuttons to imagebuttons, based on the text that would be displayed on the textbutton. This applies both to standard Ren'Py buttons ("Start Game", "Main Menu", etc) and also to buttons produced by <a href="../../reference/functions/ui.textbutton.html" title="renpy/doc/reference/functions/ui.textbutton">ui.textbutton</a>.</p>
<p><span id="theme.image_buttons" /></p>
<table>
<tr>
<td valign="top">Function:</td>
<td valign="top"><b><strong class="selflink">theme.image_buttons</strong></b></td>
<td valign="top">(d):</td>
</tr>
</table>
<div class="renpy-doc">
<p>Used to define buttons in terms of 5-tuples of image filenames. This expects its single parameter, <i>d</i>, to be a dictionary mapping untranslated button names to 5-tuples. Each 5-tuple should contain 5 filenames, giving the image used for the button when:</p>
<ul>
<li>The button is idle.</li>
<li>The button is hovered.</li>
<li>The button is selected and idle.</li>
<li>The button is selected and hovered.</li>
<li>The button is insensitive.</li>
</ul>
<p>in that order.</p>
</div>
<pre>
<span class="kwa">init python hide</span><span class="sym">:</span>
buttons <span class="sym">=</span> <span class="kwb">dict</span><span class="sym">()</span>
buttons<span class="sym">[</span><span class="str">"Start Game"</span><span class="sym">] = (</span>
<span class="str">"theme/Start Game.idle.png"</span><span class="sym">,</span>
<span class="str">"theme/Start Game.hover.png"</span><span class="sym">,</span>
<span class="str">"theme/Start Game.selidle.png"</span><span class="sym">,</span>
<span class="str">"theme/Start Game.selhover.png"</span><span class="sym">,</span>
<span class="str">"theme/Start Game.insensitive.png"</span>
<span class="sym">)</span>
theme<span class="sym">.</span><span class="kwd">image_buttons</span><span class="sym">(</span>buttons<span class="sym">)</span>
</pre>
<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>
|