public class YourClass extends Component { // creates a new SpatialObject public SpatialObject object; // select from Properties // creates a new STargetRect public STargetRect type; // select from Properties // creates a new SUIButton, @AutoWired selects the component from this object @AutoWired private SUIButton button; @Override public void start() { } @Override public void repeat() { // changes the type of SUIButton touch area button.setTargetRectType(type); // defines the object (a SUI component) which will be the touch area of SUIButton button.setTargetRectObject(object); } }