Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Horizontal block rendering #46

Merged
merged 9 commits into from
Feb 9, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP horizontal rendering
  • Loading branch information
thisandagain committed Jan 27, 2016
commit 914ad369c3a42d148e8526e9af2f2d99f4c24c48
35 changes: 35 additions & 0 deletions blocks_horizontal/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,38 @@ Blockly.Blocks['control_repeat'] = {
});
}
};

Blockly.Blocks['control_forever'] = {
/**
* Block for repeat n times (external number).
* https://blockly-demo.appspot.com/static/demos/blockfactory/index.html#5eke39
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"id": "control_forever",
"message0": "%1 %2",
"args0": [
{
"type": "input_statement",
"name": "NAME"
},
{
"type": "field_image",
"src": "https://www.gstatic.com/codesite/ph/images/star_on.gif",
"width": 15,
"height": 15,
"alt": "*"
}
],
"inputsInline": true,
"previousStatement": null,
"colour": 65,
"tooltip": ""
});

this.setHelpUrl(function () {
return 'halp me plz. k thx bye.';
});
}
};
1 change: 1 addition & 0 deletions tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<block type="event_whenflagclicked"></block>
<block type="motion_moveright"></block>
<block type="control_repeat"></block>
<block type="control_forever"></block>
<!-- <block type="control_repeat">
<value name="REPEAT">
<shadow type="math_number">
Expand Down