แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
องค์ประกอบ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ในระหว่างการวัด การบล็อกจะแบ่งออกเป็นแถวซึ่งมีองค์ประกอบที่ไม่ซ้อนทับกันและที่กั้นองค์ประกอบ
องค์ประกอบ
องค์ประกอบคือสิ่งที่มองเห็นได้ในบล็อก ตัวอย่างเช่น องค์ประกอบ
ที่แสดงถึง
แต่ละองค์ประกอบคือสี่เหลี่ยมผืนผ้าที่กำหนดขอบเขตของสิ่งที่มองเห็นได้ รวมถึงข้อมูลเพิ่มเติมบางส่วนที่เจาะจงสำหรับองค์ประกอบแต่ละประเภท
ขอบเขตขององค์ประกอบมักกำหนดโดยคลาสภายนอก (ซึ่งเป็นสิ่งที่แสดงถึง) ตัวอย่างเช่น องค์ประกอบช่องแสดงถึงช่อง และขนาดของช่องจะกำหนดตามเมธอด getSize
ของช่อง
ที่กั้นองค์ประกอบ
พื้นที่สำหรับองค์ประกอบคือพื้นที่ว่างที่เชื่อมระหว่างองค์ประกอบในแถว
ขอบเขตของพื้นที่กั้นจะกำหนดโดยข้อมูลการแสดงผลระหว่างการวัด หลังจากวัดองค์ประกอบทั้งหมดของบล็อกแล้ว ข้อมูลการแสดงผลจะแทรกช่องว่างตามขนาดที่เลือกระหว่างองค์ประกอบต่างๆ ขนาดไม่จำเป็นต้องตรงกัน ขนาดต่างๆ มักแตกต่างกันขึ้นอยู่กับองค์ประกอบที่อยู่ด้านข้างของที่กั้นระยะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eDuring the measurement phase, a block is deconstructed into rows comprising elements and element spacers for rendering purposes.\u003c/p\u003e\n"],["\u003cp\u003eElements represent the visual components of a block, including fields, icons, connections, and corners, with their size usually determined by the element they represent.\u003c/p\u003e\n"],["\u003cp\u003eElement spacers are empty spaces inserted between elements to control the spacing and visual layout of the block.\u003c/p\u003e\n"]]],["During the measurement phase, blocks are divided into rows with elements and spacers. Elements, such as fields, icons, connections, and corners, are represented by rectangles with specific data. Their sizes are dictated by external classes, like a field's `getSize` method. Element spacers are empty spaces inserted between elements by the render info, with varying sizes based on the adjacent elements. The render info determines spacer sizes after measuring all block elements.\n"],null,["# Elements\n\nDuring [measurement](/blockly/guides/create-custom-blocks/renderers/concepts/info) the block gets broken up into [rows](/blockly/guides/create-custom-blocks/renderers/concepts/rows)\ncontaining non-overlapping elements and element spacers.\n\nElements\n--------\n\nElements represent visual things on a block. Examples include elements\nrepresenting:\n\n- Fields\n- Icons\n- Connections\n- Corners\n\nEach element is a rectangle defining the bounds of the visual thing, plus some\nextra data specific to each kind of element.\n\nThe bounds of the element are usually determined by some external class\n(that is, the thing they represent). For example,\n[field elements](/blockly/reference/js/blockly.blockrendering_namespace.field_class) represent fields, and their size is determined\nby the field's [`getSize`](/blockly/reference/js/blockly.field_class.getsize_1_method) method.\n\nElement spacer\n--------------\n\nAn element spacer is an empty space that goes between elements in a row.\n\nThe bounds of spacers are determined by the [render info](/blockly/guides/create-custom-blocks/renderers/concepts/info) during\nmeasurement. After measuring all of the elements of the block, the\n[render info](/blockly/guides/create-custom-blocks/renderers/concepts/info) inserts spaces of its chosen size between\nthe elements. The sizes don't have to be consistent; they are often different\ndepending on the elements to either side of the spacer."]]