feat(boards): python_mixpy下更新Turtle模块
增加screen.update、turtle.title和turtle.setup接口对应图形块
This commit is contained in:
@@ -437,6 +437,38 @@ export const turtle_bgcolor = {
|
||||
}
|
||||
};
|
||||
|
||||
export const turtle_title = {
|
||||
init: function () {
|
||||
this.setColour(TURTLE_HUE);
|
||||
this.appendValueInput('TITLE')
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_TURTLE_TITLE_SET);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const turtle_setup = {
|
||||
init: function () {
|
||||
this.setColour(TURTLE_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_TURTLE_SETUP_SET);
|
||||
this.appendValueInput('WIDTH')
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_WIDTH);
|
||||
this.appendValueInput('HEIGHT')
|
||||
.setCheck(null)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_HEIGHT);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const turtle_tracer = {
|
||||
init: function () {
|
||||
this.setColour(TURTLE_HUE);
|
||||
@@ -825,6 +857,19 @@ export const turtle_getscreen = {
|
||||
|
||||
}
|
||||
|
||||
export const turtle_update = {
|
||||
init: function () {
|
||||
this.setColour(TURTLE_HUE);
|
||||
this.appendValueInput('TUR');
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_TURTLE_UPDATE);
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const turtle_onkey = {
|
||||
init: function () {
|
||||
this.setColour(TURTLE_HUE);
|
||||
|
||||
Reference in New Issue
Block a user