<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[在舞台上打印文字]]></title><description><![CDATA[<h2><a class="anchor-offset" name="介绍"></a>介绍</h2>
<p dir="auto">在麻省理工Scratch平台上，若要在舞台窗口显示文字，就必须把文字添加到造型中。而在创益编程游乐场，你可以用积木“打印文本”打印任意文本，非常简单。<br />
 <br />
 </p>
<h2><a class="anchor-offset" name="积木-打印"></a>积木：“打印”</h2>
<p dir="auto">你可以在外观类别中找到积木“打印”。</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/17749694-dc1c-4ef2-81ca-fc119b1ffd68.png" width="500" /><br />
 </p>
<h3><a class="anchor-offset" name="参数"></a>参数</h3>
<ul>
<li>
<p dir="auto"><strong>打印的文本</strong>：你想在舞台窗口打印的文本。要注意，文字全都打印在一行。</p>
</li>
<li>
<p dir="auto"><strong>中心位置</strong>：文本中心的x坐标、y坐标。例如，如果x、y都为0，那么文本的中心就在播放器窗口中心。</p>
</li>
<li>
<p dir="auto"><strong>边界框尺寸</strong>：宽度、高度决定文本的大小。文本的宽度不能超过这个宽度，文本的高度不能超过这个高度。大多数情况下，这2个限制条件只有一个起作用。例如，如果你把宽度设置得很大，文本的最终尺寸将根据高度而定。</p>
</li>
<li>
<p dir="auto"><strong>颜色</strong>：你可以设置文本的颜色，甚至可以带透明度。</p>
</li>
</ul>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="范例"></a>范例</h2>
<p dir="auto">在这个程序中，我们打印2行文本，大小不同，“你好！”为半透明：</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5b160b48-2fc2-457d-a0cb-297e456444cc.png" width="600" /></p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/1bf6bd0d-f96a-49c5-bc48-dc9e40b798cf.png" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="打印一定的时间"></a>打印一定的时间</h2>
<p dir="auto">用另一个近似的“打印”积木，打印的文本显示一定时间，然后自动清除：</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/e0c7b495-5247-4f25-bb8e-f49db7ae2190.png" width="600" /></p>
<p dir="auto">你只需要在最后一个输入框指定文本显示的秒数。</p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="清除文本"></a>清除文本</h2>
<p dir="auto">每当你点击绿旗按钮，所有打印内容都被自动清除。然而，如果你想在程序运行中清除打印文本，可以用以下2个积木：</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/66ed5297-da14-46a6-8e0d-9798157d31ed.png" width="150" /></p>
<p dir="auto">这个积木会清除本角色打印的全部文本。</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/63387a6c-683e-4efd-b114-2c55ac1908be.png" width="110" /></p>
<p dir="auto">这个积木会清除项目中所有角色打印的全部文本。</p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="范例"></a>范例</h2>
<p dir="auto">该程序每秒打印一次计时器的值，同时也会清除之前的打印文本。</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/71195fa3-5bf7-4c33-bc40-86b28b797144.gif" width="900" style="border-radius:5px;border:1px solid #29622d" /></p>
]]></description><link>https://forum.creaticode.com/topic/584/在舞台上打印文字</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Nov 2026 14:10:35 GMT</lastBuildDate><atom:link href="https://forum.creaticode.com/topic/584.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Sep 2022 10:50:49 GMT</pubDate><ttl>60</ttl></channel></rss>