Moving text blocks in ModKit

#1

In VEX coding studio, is there a way to move text blocks around without going back to block view? (When programming robots with Modkit.)

0 Likes

#2

Yes. You can just cut and paste stuff in the text section, and the blocks will adjust. To confirm it, I just made this code using blocks:

when(STARTED){
  while(true){
    wait(1,seconds);
    if(Brain.Screen.pressing()){
    }
  }
}

I cut and pasted the wait() command to here:

when(STARTED){
  while(true){
    if(Brain.Screen.pressing()){
    }
    wait(1,seconds);
  }
}

The blocks adjusted appropriately. So just cut and paste like you might otherwise do to move a line of code.

0 Likes

#3

What about when you have different event handlers?

0 Likes

#4

I didn’t realize Modkit had event handlers built into it. When I looked at sensing the controller I didn’t see the .pressed and .released methods, so I just figured Modkit didn’t use event handlers. That wouldn’t have been surprising to me since VEX stated more things would be available at higher levels of coding.

0 Likes