Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
blockly > IIcon > initView
Metode IIcon.initView()
Membuat elemen SVG untuk ikon yang akan ditempatkan di blok.
Tanda Tangan:
initView(pointerdownListener: (e: PointerEvent) => void): void;
Parameter
Parameter |
Jenis |
Deskripsi |
pointerdownListener |
(e: PointerEvent) => kosong |
Pemroses peristiwa yang harus dilampirkan ke elemen SVG root dengan mengimplementasikan initView . Digunakan oleh sistem gestur Blockly untuk menangani klik dan tarik dengan benar. |
Hasil:
void
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-08-22 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2024-08-22 UTC."],[[["The `initView` method is responsible for creating the SVG elements that visually represent the icon on a block."],["It takes a `pointerdownListener` function as an argument, which needs to be attached to the icon's root SVG element for proper click and drag handling."],["The method does not return any value (void)."]]],["The `initView` method, part of the `IIcon` interface, is responsible for generating the SVG elements of an icon on a block. It requires a `pointerdownListener` function as a parameter. This listener must be added to the root SVG element and is used by Blockly for click and drag event handling. The method returns no value.\n"]]