[request] guide extension: various improvements

Bug #1566645 reported by Sam Gleske
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

I notice that you allow customizing the font size of the text overlay in the guide extension. However, it would be nice if I could customize, rather disable, the overlay.

Relevant source files that I could find.

https://github.com/sikuli/sikuli/blob/develop/extensions/guide/src/main/python/guide/guide.py

https://github.com/sikuli/sikuli/blob/develop/extensions/guide/src/main/java/org/sikuli/guide/SikuliGuideText.java

https://github.com/sikuli/sikuli/blob/develop/extensions/guide/src/main/java/org/sikuli/guide/SikuliGuideComponent.java

If this is possible, it's not obvious to me yet.

Sam Gleske (sam-mxracer)
description: updated
Revision history for this message
Sam Gleske (sam-mxracer) wrote :

Seems it has to do with the _g variable in guide.py.

https://github.com/sikuli/sikuli/blob/develop/extensions/guide/src/main/java/org/sikuli/guide/SikuliGuide.java

Need to somehow call _g.setDarken(false) from python.

summary: - Customize guide extension overlay
+ Disable guide extension overlay
Revision history for this message
Sam Gleske (sam-mxracer) wrote : Re: Disable guide extension overlay

https://github.com/sikuli/sikuli/blob/develop/extensions/guide/src/main/java/org/sikuli/guide/SikuliGuide.java#L790

I'm thinking TransparentWindow.setOpacity(1f) is actually what is causing the overlay. It would be nice to make it zero so that the overlay isn't visible at all.

Revision history for this message
Sam Gleske (sam-mxracer) wrote :

And to expose disabling the overlay via python guide module.

Revision history for this message
RaiMan (raimund-hocke) wrote :

@Sam
you are rather busy with more complex features of SikuliX ;-)

I did not look into the Guide feature for some months (not the top priority).
But I will have a look into it the next days, to update/fix some things towards final 1.1.1 end of April.
Watch the nightly builds 1.1.1 until then.

Thanks for your input.

Revision history for this message
Sam Gleske (sam-mxracer) wrote :

Hi RaiMan, I'm using it to play a game (and I happen to be a programmer) :).

Since you seem curious, here's the script that I've been writing with your guidance. Thank you for your guidance :)

https://gist.github.com/samrocketman/12057af8bbf1463ca2a6

Revision history for this message
Sam Gleske (sam-mxracer) wrote :

How I plan to use the guide feature is an overlay on my game with a countdown timer (e.g. count down seconds) for certain functions. This way I know when I'm ready to hit the button again while I'm playing.

Thank you for your work on SikuliX RaiMan. As I get more familiar with the code base I hope I can start giving you code patches in addition to my bug reports.

Revision history for this message
Sam Gleske (sam-mxracer) wrote :

Think of it like a tactictical display :)

Revision history for this message
RaiMan (raimund-hocke) wrote :

thanks for the information. understood.

... but be aware: you cannot change a guide element's content, while it is "displayed".
So to display something, that changes (count down in this case) it's contents in synchronisation with what is happening on the screen sounds rather challenging (at least with the current means of SikuliX being on the Python level).

Revision history for this message
Sam Gleske (sam-mxracer) wrote :

I don't need to change the contents of guide that is already displayed. In each instance, the guide is removed and re-displayed for the countdown.

e.g.

from guide import guide
for x in range(1,4):
  guide.tooltip(Region(100,100,50,50), str(x))
  guide.show(1)

That will display and wipe 3 times for a 3 second countdown.

I haven't tested it yet but I'd like to be able to interact with another application while that overlay is displayed.

Revision history for this message
Sam Gleske (sam-mxracer) wrote :

err, count up...

Revision history for this message
RaiMan (raimund-hocke) wrote :

ok, thanks.

based on this example please list again, what you want to have fixed/added with the guide feature.

currently at Python script level:
- the guide overlay blocks the whole screen, while being displayed
- the overlay is nearly transparent (slightly dimming)
- the above usage leads to some flickering

RaiMan (raimund-hocke)
summary: - Disable guide extension overlay
+ [request] guide extension: various improvements
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.0
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 2.0.0 → 2.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.