Skip to content

Instantly share code, notes, and snippets.

@onelittlenightmusic
Last active January 3, 2019 00:57
Show Gist options
  • Save onelittlenightmusic/2593196e8c71c9d13dd1459a6ccb3236 to your computer and use it in GitHub Desktop.
Save onelittlenightmusic/2593196e8c71c9d13dd1459a6ccb3236 to your computer and use it in GitHub Desktop.
class Test {
constructor() {}
getInfo() { // 拡張機能の各種情報
return {
id: 'test',
name: 'Test', // 拡張機能の名前
blocks: [ // 各ブロックの定義
{
opcode: 'hello', // このブロックが実行されると、helloという関数が呼ばれる
blockType: Scratch.BlockType.COMMAND, // 「10歩動かす」のような通常の命令ブロック
text: 'hello' // ブロックに表示されるテキスト
}
]
}
}
hello() {
console.log('hello'); // console log に hello と出力
}
}
// Scratch.extensions.register(new Test());
module.exports = Test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment