Skip to content

Commit a796ccd

Browse files
committed
[ADD] converter of display_text function
1 parent eb90aa1 commit a796ccd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib/ruby-to-blocks-converter/microbit.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ const MicroBitConverter = {
5959
);
6060
}
6161
break;
62+
case 'display_text':
63+
if (args.length === 1 && this._isString(args[0])) {
64+
block = this._changeBlock(receiver, 'microbit_displayText', 'sentence');
65+
delete this._context.blocks[receiver.inputs.EXPRESSION.block];
66+
delete receiver.inputs.EXPRESSION;
67+
68+
this._addTextInput(block, 'TEXT', args[0], 'Hello!');
69+
}
70+
break;
6271
}
6372
}
6473
return block;

0 commit comments

Comments
 (0)