연구 설문조사: Blockly 사용 경험을 알려주세요
설문조사 시작
도구 상자
도구 상자에는 프로그래밍에 사용하는 블록이 포함되어 있습니다. 블록을 워크스페이스로 드래그할 수 있습니다.
도구 상자의 모양에 관한 자세한 내용은 시각적 용어집을 참고하세요.
기본 정의
도구 상자 정의는 도구 상자에 포함되는 블록과 순서를 지정합니다. 도구 상자의 모양과 스타일은 대부분 다른 방법으로 지정됩니다.
JSON을 사용하여 도구 상자를 정의하는 것이 좋습니다.
다음 코드 스니펫은 두 개의 블록이 있는 플라이아웃 도구 상자를 정의합니다.
const toolbox = {
// There are two kinds of toolboxes. The simpler one is a flyout toolbox.
kind: 'flyoutToolbox',
// The contents is the blocks and other items that exist in your toolbox.
contents: [
{
kind: 'block',
type: 'controls_if'
},
{
kind: 'block',
type: 'controls_whileUntil'
}
// You can add more blocks to this array.
]
};
// The toolbox gets passed to the configuration struct during injection.
const workspace = Blockly.inject('blocklyDiv', {toolbox: toolbox});

도구 상자를 정의하고 구성하는 방법에 관한 자세한 내용은 도구 상자 개요를 참고하세요.
삽입에 대한 자세한 내용은 작업공간 만들기를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-11-04(UTC)
[null,null,["최종 업데이트: 2024-11-04(UTC)"],[[["The Blockly toolbox houses programming blocks that users can drag onto the workspace to build programs."],["Toolboxes are typically defined using JSON to specify which blocks are included and their arrangement."],["The provided code snippet demonstrates creating a basic flyout toolbox containing 'controls_if' and 'controls_whileUntil' blocks."],["Further information regarding toolbox configuration and workspace injection can be found in the linked resources."]]],["The toolbox, containing program blocks, is defined using JSON and can be dragged onto the workspace. A flyout toolbox, a simpler type, is specified by its `kind` and `contents`. The `contents` array lists blocks, defined by their `kind` and `type`, such as `controls_if` and `controls_whileUntil`. This toolbox definition is then passed to the configuration during the workspace injection process using `Blockly.inject`.\n"]]