Zho:当背景换成 ()（积木）

The 当背景换成  积木 is an 事件类积木 and a 半圆形积木. 程式 that wear this block will be triggered once the specified 背景 has been switched to on the 舞台.

用法示例
背景換成 [level1 v] 當背景換成 [level1 v] // 在角色上 定位到 x: (0) y: (0)
 * Starting a level

背景換成 [game over v] // 在舞台上 當背景換成 [game over v] // in a sprite 隱藏
 * A game over message

背景換成 [menu 3 v] 當背景換成 [menu 3 v] // 當 "menu 3" 被開啟時 圖層上移至頂層 // 因此 menu 的項目會顯示在最前面 顯示 // 這會開啟 menu
 * Switching among menus

递归
This block can use 递归 to continuously run scripts. An example is as follows: 當背景換成 [snow storm v] // a background switch must first be triggered to begin the recursion . . . 背景換成 [sunny day v] // which will trigger the next script

當背景換成 [sunny day v] .. . 背景換成 [snow storm v] // starts the cycle over

应用
When the backdrop changes, sprites with the 当背景换成 block, and the attribute as the backdrop being changed to (meaning the selected backdrop within the block is what is being switched to), the sprites will react and run their scripts beginning with this hat block. 广播 can be used to replicate this situation, though there may be a miniscule delay due to an extra block being added. The following is a workaround, often used in Scratch 1.x: 背景換成 [valley v] 廣播訊息 [valley v]

當收到訊息 [valley v] .. .

参见

 * 背景
 * 背景换成
 * 背景换成 并等待
 * 背景名称
 * 背景编号