--
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.
To view this discussion visit https://groups.google.com/d/msgid/blockly/1fbd10ee-d51a-4397-b804-7b0187b54fbcn%40googlegroups.com.
--
To view this discussion visit https://groups.google.com/d/msgid/blockly/43f8c027-509e-4756-9f68-178b19a5e957n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/blockly/5b0697b7-fe0c-451f-8cad-13197c316162n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/blockly/5b0697b7-fe0c-451f-8cad-13197c316162n%40googlegroups.com.
Okey. Let me explain what exactly I am looking for.
One of my blocks in the program is a line (X1 Y1,X2,Y2) and its result is drawn on a canvas. Now I want to create a loop type block in which I can put my line block and it draws as many lines as you input into the loop block. Of course the XY must change for every loop.
--
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.
To view this discussion visit https://groups.google.com/d/msgid/blockly/8ed0a5a0-8659-4ed4-ab87-257949c55625n%40googlegroups.com.
Blockly.Blocks["CrtaXY"] = {init: function(){this.appendDummyInput().appendField("Narisi crto z X1 koordinato") // tekst na bloku.appendField(new Blockly.FieldNumber(0), "X1"); // vnesem X1 koordinatothis.appendDummyInput().appendField("Narisi crto z Y1 koordinato").appendField(new Blockly.FieldNumber(0), "Y1"); // vnesem Y1 koordinatothis.appendDummyInput().appendField("Narisi crto z X2 koordinato").appendField(new Blockly.FieldNumber(0), "X2"); // vnesem X2 koordinatothis.appendDummyInput().appendField("Narisi crto z Y2 koordinato").appendField(new Blockly.FieldNumber(0), "Y2"); // vnesem Y2 koordinatothis.setPreviousStatement(true, null); // lahko se poveze zgorajthis.setNextStatement(true, null); // lahko se poveze spodajthis.setColour(160); // barva bloka}};
[set x1 to 0]
[set y1 to 0]
[set x2 to 50]
[set y2 to 0]
[set increment to 100]
[count with i from 0 to 9 by 1]
[line [x1] [y1 - [increment * i]] [x2] [y2 - [increment * i]]]