How do inputs on custom blocks work

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.
Screen recording 2025-04-11 9.54.21 AM MConverter.eu

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

Click on the part that says number (for me it’s number, for you its the x coord). Then drag and drop it into the part. If you want to change the value of the input, well you can’t, you would need to create a variable that is equal to the input

1 Like