סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
blockly > blockRendering > חלונית הזזה > שרטוט
שיטת blockRendering.Drawer.draw()
משרטטים את הבלוק לסביבת העבודה. כאן "שרטוט" הוא להגדיר רכיבי נתיב SVG ולהעביר שדות, סמלים וחיבורים במסך.
החלקים של הנתיבים נדחפים למערכים של 'שלבים'. השלבים האלה משולבים באמצעות רווחים ומגדירים ישירות בבלוק. כך אפשר להבטיח שהשלבים מופרדים ברווחים כדי לשפר את הקריאוּת, אבל זו לא חובה.
Signature:
draw(): void;
החזרות:
ריק
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-08-29 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2024-08-29 (שעון UTC)."],[[["The `blockRendering.Drawer.draw()` method visually renders a block on the workspace by manipulating SVG elements for its shape, fields, icons, and connections."],["This method achieves the visual representation by constructing SVG paths, dividing them into \"steps,\" and applying them directly to the block element for clear and readable rendering."],["The process focuses on updating the visual aspects of the block on the workspace without returning any specific value."]]],["The `draw()` method, part of the `blockRendering.Drawer` class, is responsible for rendering a block onto the workspace. This involves setting SVG path elements and positioning fields, icons, and connections. The method constructs the block's path by pushing path segments into \"steps\" arrays. These steps are then joined with spaces and assigned directly to the block. The method does not take any arguments and does not return anything.\n"]]