סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
Elements
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
במהלך המדידה, הבלוק מתחלק לשורות שמכילות רכיבים שאינם חופפים ומרווחים בין רכיבים.
Elements
רכיבים מייצגים רכיבים חזותיים בבלוק. דוגמאות: אלמנטים שמייצגים:
כל רכיב הוא מלבן שמגדיר את הגבולות של הדבר החזותי, יחד עם נתונים נוספים הספציפיים לכל סוג של רכיב.
הגבולות של הרכיב נקבעים בדרך כלל על ידי מחלקה חיצונית כלשהי (כלומר, הדבר שהם מייצגים). לדוגמה, רכיבי שדה מייצגים שדות, והגודל שלהם נקבע לפי שיטת getSize
של השדה.
רכיב מרווח
מפריד רכיבים הוא שטח ריק שעובר בין רכיבים בשורה.
הגבולות של הספייסרים נקבעים לפי פרטי העיבוד במהלך המדידה. אחרי מדידה של כל רכיבי הבלוק, פרטי העיבוד יוסיפו רווחים בגודל שנבחר בין הרכיבים. המידות לא חייבות להיות עקביות, ובדרך כלל הן משתנות בהתאם לרכיבים שנמצאים בכל אחד מצידי המרווח.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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."]]