From Test-Scratch-Wiki

变数 () 隐藏
變數 [ v] 隱藏
类别 变量类积木
形狀 条形积木
加入於 1.3

The Hide Variable () 积木 is a 变量类积木 and a 条形积木. The block hides the specified variable's 舞台监控视窗.

用法示例

In 专案 that use variables' 舞台 monitors to display things, the displays may have to hide and show at times; this can be done with the 变数 () 显示.

  • Hiding a slider when a value is not editable
當角色被點擊 // a button to lock-in or open the value editing
如果 <(editable) = [yes]> 那麼 
  變數 [width v] 隱藏
  變數 [editable v] 設為 [no]
否則
  變數 [width v] 顯示
  變數 [editable v] 設為 [yes]
end
  • Hiding the score at the end of a game
當 @greenflag 被點擊
變數 [points v] 設為 (0)
變數 [status v] 設為 [running]
變數 [points v] 顯示
重複直到 <<(status) = [running]> 不成立> 
  定位到 x: (隨機取數 (-240) 到 (240)) y: (隨機取數 (-180) 到 (180))
  變數 [lastTime v] 設為 (計時器)
  等待直到 <<((timer) - (lastTime)) > (.3)> 或 <<滑鼠鍵被按下?> 且 <碰到 [滑鼠游標 v] ?>>>
  如果 <<滑鼠鍵被按下?> 且 <碰到 [滑鼠游標 v] ?>> 那麼 
    變數 [points v] 改變 (1)
    播放音效 [pop v]
    如果 <(points) = [10]> 那麼 
      變數 [status v] 設為 [win]
    end
  end
  如果 <(timer) > (10)> 那麼 
    變數 [status v] 設為 [lose]
  end
end
廣播訊息 (status)
等待 (2) 秒
變數 [points v] 隱藏
  • When the variable has no use anymore
當收到訊息 [game end v]
變數 [score v] 隱藏

参见

Cookies help us deliver our services. By using our services, you agree to our use of cookies.