調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
レンダラ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックの形状は、ブロックの定義(フィールドと接続)に基づいてレンダラによって決定されます。
組み込みレンダラ
Blockly には 3 つのレンダラが組み込まれており、それぞれがプログラムに少し異なる外観を与えます。
レンダリング |
説明 |
画像 |
Thrasos
|
推奨されるレンダラ。より均一な間隔と実線の境界線を備えた、よりモダンな geras レンダラです。 |
|
Geras
|
デフォルトのレンダラ。これは、Blockly が構築された元のレンダラです。 |
|
Zelos |
Scratch-3.0 ブロック設計に基づくレンダラ。 |
 |
これらのレンダラを使用するには、名前を構成オプションに渡します。
Blockly.inject('blocklyDiv', {
renderer: 'thrasos'
});
カスタム レンダラ
組み込みレンダラとは異なる外観をプログラムに持たせたい場合は、カスタム レンダラを作成することもできます。始めるにあたって、Blockly チームは次のことをおすすめします。
- レンダラのコンセプトに関するドキュメントで、レンダラのすべてのコンポーネントがどのように連携しているかを確認します。
- カスタム レンダラ Codelab を完了して、カスタム レンダリングの実践演習を行います。
- プロジェクトにデバッグ レンダラを追加します。
- レンダラをカスタマイズする。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eBlock shape is determined by a renderer based on the block's definition, including fields and connections.\u003c/p\u003e\n"],["\u003cp\u003eBlockly offers three built-in renderers: Thrasos (recommended), Geras (default), and Zelos (Scratch-3.0 based).\u003c/p\u003e\n"],["\u003cp\u003eCustom renderers can be created for unique program aesthetics by following documentation and tutorials.\u003c/p\u003e\n"]]],[],null,["# Renderers\n\nThe shape of a block is determined by a renderer, based on the\n[block's definition](/blockly/guides/create-custom-blocks/define/block-definitions) (that is, its fields and connections).\n\nBuilt-in renderers\n------------------\n\nBlockly provides three built-in renderers, each of which give a slightly\ndifferent feel to the program.\n\n| Renderer | Description | Image |\n|----------|---------------------------------------------------------------------------------------------------------------------|-------|\n| Thrasos | The recommended renderer. It is a more modern take on the geras renderer, with more even spacing and solid borders. | |\n| Geras | The default renderer. It is the original renderer that Blockly was built with. | |\n| Zelos | A renderer based on Scratch-3.0 block design. | |\n\nTo use one of these renderers, pass the name into the configuration options: \n\n Blockly.inject('blocklyDiv', {\n renderer: 'thrasos'\n });\n\nCustom renderers\n----------------\n\nIf you want to give your program a different look and feel than any of the\nbuilt-in renderers, you can also create a custom renderer. To get started the\nBlockly team recommends you:\n\n1. Read through the [renderer concept docs](/blockly/guides/create-custom-blocks/renderers/concepts/overview) to learn how all of the components of a renderer fit together.\n2. Complete the [custom renderer codelab](https://blocklycodelabs.dev/codelabs/custom-renderer/index.html) to get hands-on practice with custom rendering.\n3. Add the [debug renderer](https://www.npmjs.com/package/@blockly/dev-tools#debug-renderer) to your project.\n4. Customize your renderer."]]