調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
フィールドとアイコン
フィールドとアイコンはどちらもブロックに表示される視覚要素ですが、目的が異なります。
フィールドは、プログラムの機能に影響を与えるブロックに関するデータを表示または定義します。たとえば、テキスト ブロックには、文字列の定義であることを示す 2 つの引用符と、その文字列を定義できるテキスト入力があります。引用符はブロックの機能を示し、入力を入力することで関数を変更できます。
アイコンは、ブロック自体の「メタ」情報を表示または定義します。たとえば、任意のブロックにコメント アイコンを追加できます。このアイコンはメモを自身に書くことができますが、プログラム内のブロックがどのように機能するかには影響しません。
機能の比較
属性 |
フィールド |
アイコン |
レンダリング
|
フィールドは任意の要素で構成できます。 |
アイコンは好きな要素で作成できます |
数値
|
フィールドはそれぞれ、ブロック内に任意の回数で表示されます。 |
各アイコンはブロック内に 1 回表示できます。 |
配置
|
フィールドは、ブロックの任意の入力上の任意の場所に配置できます。 |
アイコンは常にブロックの先頭に配置されます。 |
シリアル化
|
フィールドはシリアル化が可能で、多くの場合はシリアル化されます。 |
アイコンはシリアル化できますが、多くの場合、状態を持たないためシリアル化できません。 |
折りたたみ
|
ブロックを閉じ、代わりにテキストを表示すると、フィールドは非表示になります。 |
アイコンは、ブロックが閉じられたときにアイコンを表示するか非表示にするかを制御できます。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2023-12-02 UTC。
[null,null,["最終更新日 2023-12-02 UTC。"],[[["Fields define a block's data and functionality, while icons provide metadata or supplemental information about the block."],["Fields can have multiple instances, flexible positioning, and are often serialized, whereas icons are singular, positioned at the top-start, and may not always be serialized."],["Both fields and icons are visual elements on a block and offer flexibility in their rendering using various elements."]]],["Fields and icons are distinct visual elements on a block with different purposes. Fields display or define data affecting a program's function, like the quotation marks and text input on a text block. Icons provide \"meta\" information about a block, such as a comment icon, which doesn't impact program function. Fields can appear multiple times, have varied rendering and placement, and are often serialized. Icons appear once per block, are fixed at the top-start, and are often not serialized, but can control visibility when a block is collapsed.\n"]]