Skip to content

Conversation

@takaokouji
Copy link

No description provided.

return [key, Generator.ORDER_ATOMIC];
};

Generator.makeymakey_whenMakeyKeyPressed = function (block) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここが ^[スペースキー▼]が押されたとき| ブロックを self.when(:makey_key_pressed, "SPACE") do 〜 end というRubyのプログラムに変換するところです。

* @return {RubyGenerator} same as param.
*/
export default function (Generator) {
Generator.makeymakey_menu_KEY = function (block) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここは、 [スペースキー▼]"SPACE" という文字列に変換する処理です。どうやって、 makeymakey_menu_KEY という名前を見つけるかが難しいところです。

まず /smalruby3-gui/node_modules/scratch-vm/src/extensions/scratch3_makeymakey/index.jsgetInfo メソッドをみます。

その中から menus: { という記述を見つけます。

すぐ下に KEY { とありますが、これが名前です。

id(=makeymakey) と menus と ↑の KEY を組み合わせて
makeymakey_menus_KEY という名前を導きました。

@takaokouji takaokouji merged commit 52673a1 into develop Oct 25, 2019
@takaokouji takaokouji deleted the makeymakey_block_to_ruby branch October 25, 2019 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants