onVanish not working on specific region
I am relatively new to Sikuli and python.I am running Sikuli on a MAC 10.9.5.
I am having trouble getting onVanish to work. I have extracted the relevant code to highlight the problem. The code is monitoring a game. As part of the game there is an image that moves periodically from one position to another. First consider the following
def imageMoved(event):
self.monitor = False
event.
self.monitor = True
image = Image()
currentImageRegion = image.region() # currentImageRegion redundant in this first version
if currentImageReg
onVanish(
while self.monitor == True:
# monitoring stuff
Here currentImageRegion is redundant. Here I assume "onVanish(
Now for the problem:-
def imageMoved(event):
self.monitor = False
event.
self.monitor = True
image = Image()
currentImageRegion = image.region()
if currentImageReg
currentImageRe
while self.monitor == True:
# monitoring stuff
In this piece of code onVanish is applied to the region currentImageRegion. This is a small region around the initial position of the image. I know that it is as I can see it due to the "currentImageRe
In conclusion it seems that onVanish is only working when applied to the whole screen and not a more specific region of the screen. Am I doing something wrong? Thanks in anticipation of any help.
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: