Skip to content

Conversation

@t-kazu
Copy link
Collaborator

@t-kazu t-kazu commented Oct 16, 2018

命令ブロック Ruby
screenshot from 2018-10-16 16-05-21 screenshot from 2018-10-16 16-05-27


Blockly.Ruby.looks_setsizeto = function (block) {
const size = Blockly.Ruby.valueToCode(block, 'SIZE', Blockly.Ruby.ORDER_NONE) || '0';
return `set_size(${size})\n`;

Choose a reason for hiding this comment

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

self.size = ${size}


Blockly.Ruby.looks_changesizeby = function (block) {
const change = Blockly.Ruby.valueToCode(block, 'CHANGE', Blockly.Ruby.ORDER_NONE) || '0';
return `change_size_by(${change})\n`;

Choose a reason for hiding this comment

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

self.size += ${change}

Blockly.Ruby.looks_goforwardbackwardlayers = function (block) {
const layer = Blockly.Ruby.valueToCode(block, 'NUM', Blockly.Ruby.ORDER_NONE) || '0';
const forwardBackward = block.getFieldValue('FORWARD_BACKWARD') || null;
return `go_layer(${layer}, "${forwardBackward}")\n`;

Choose a reason for hiding this comment

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

go_layers(${layer}, :${forwardBackward})


Blockly.Ruby.looks_gotofrontback = function (block) {
const frontBack = block.getFieldValue('FRONT_BACK') || null;
return `go_to_layer("${frontBack}")\n`;

Choose a reason for hiding this comment

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

go_to_layer(:${frontBack})

@t-kazu t-kazu force-pushed the feature/rubygenerator-for-looks-blocks branch from c0f677e to 19d6cb5 Compare October 16, 2018 07:23
@takaokouji takaokouji merged commit 41cb7c7 into smalruby:develop Oct 16, 2018
@t-kazu t-kazu deleted the feature/rubygenerator-for-looks-blocks branch October 17, 2018 10:22
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