So Im working on a project that requires custom blocks. The custom blocks need inputs but i dont know how to get the inputs on the custom blocks to actually change what happens. Like, for example, if i made a custom block that ill call “draw rectanle” and it has 2 inputs, one for x-coord and one for y-coord; and then i define it as printing a rectangle of a certain size, how would I get the inputs in “draw rectangle” to actually change where the rectangle it draws gets placed.
The way drawing a rectangle works is
- Value 1: Top Left Corner X coordinate
- Value 2: Top Left Corner Y coordinate
- Value 3: Width of the rectangle
- Value 4: Height of the rectangle
Then using the the brain screen with this image.
1 Like
If you’re asking what I think you’re asking, the labeled spots for inputs in the define header can be dragged out and placed where the numbers would be. example below.
4 Likes
The inputs are variables. Here is a link to an explanation of how to use them: https://kb.vex.com/hc/en-us/articles/360046831112-Using-My-Blocks-in-VEXcode-V5