How to properly use observe to track region changes
This question pertains to the SikuliX 1.1.1 Java API.
I am trying to figure out how to track a region I have defined.
Specifically, my region encapsulates a character on the screen. I want to observe when he stops moving.
When he stops moving, I want to call a different function.
I believe I should use observe() and track onChange(), which will tell me when the character is moving. And when
onChange() reports false, it will tell me my character has stopped.
But I cannot seem to figure out how to get the onChange results()
to evaluate when he's moving and when he's not. I am not setting up the
observe functionality correctly.
This is what I have so far:
public void targetChanged(
Region x = e.getRegion();
System.
}
public static void main(String[] args){
Screen s = new Screen();
Region r = new Region(
Location l = r.getCenter();
Region characterRegion = new Region(l.x, l.y, 30, 40).offset(new Location(-30/2, -40/2));
characterRegio
characterRegio
}
Currently the program just terminates.
What do I need to change to get my desired functionality?
I'm having trouble figuring out the documentation.
Detailed advice, explanations, and examples are appreciated.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: