--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Blockly.Blocks['frontend'] = {
init: function() {
this.appendDummyInput()
.appendField("set");
this.appendValueInput("row")
.setCheck("Number")
.appendField("ROW");
this.appendValueInput("col")
.setCheck("Number")
.appendField("COLUMN");
this.appendDummyInput()
.appendField("to")
.appendField(new Blockly.FieldDropdown([["Wall","\"wall\""], ["Blank","\"blank\""]]), "item");
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(330);
this.setTooltip("");
this.setHelpUrl("");
}
};Blockly.PHP['frontend'] = function(block) {
var value_row = Blockly.PHP.valueToCode(block, 'row', Blockly.PHP.ORDER_ATOMIC);
var value_col = Blockly.PHP.valueToCode(block, 'col', Blockly.PHP.ORDER_ATOMIC);
var dropdown_item = block.getFieldValue('item');
// TODO: Assemble PHP into code variable.
var code = 'build(' + value_row + ',' + value_col + ',' + dropdown_item + ');\n';
return code;
};function build($rows, $cols, $build_items){
//more stuff Hi Maziar,Can you send what your generator looks like for that block? I suspect that's where your issue is.
On Thu, Oct 5, 2017 at 8:17 AM, Maziarser <mazyar...@gmail.com> wrote:
Hi all,I have made a block that the user should give it a "row" number and a "column" number and an "object name":The PHP code which is generated is like below and the output is working fine:room(18,30,"wall");But I want to show the generated PHP code like below as it is a "Multidimensional Array":room[18][30]= $wall;Thanks for your help and time in advance!Maziar
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.
function build($rows, $cols, $build_items){//do stuff}ORfunction room($rows, $cols, $build_items){//do stuff}To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+unsubscribe@googlegroups.com.