Author Topic: Screenshots and how to check if a file exists  (Read 2309 times)

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Screenshots and how to check if a file exists
« on: September 18, 2018, 01:06:20 AM »
I want to do this: take a screenshot of AM and then load it as an image file.
I can easily write a routine that scans through the AM folder and selects the last screenshot pathname. My idea was to do something like, in a on_signal routine:

generate the screenshot through signal("screenshot")
run through the folder and get the filename
add the filename to the image

The issue is that, as far as I can see, it takes some time to create the screenshot so the routine finds the previous one. Is there a way to wait until the intended file is created?

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Screenshots and how to check if a file exists
« Reply #1 on: September 21, 2018, 02:15:43 PM »
Let me rephrase this: I want to take a screenshot each time the Transition.ShowOverlay happens, but if I do this:

if (ttype == Transition.ShowOverlay){
    fe.signal("screenshot")
}

the screenshot is created only _after_ I leave the overlay menu. Is there a workaround for that?

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Screenshots and how to check if a file exists
« Reply #2 on: September 24, 2018, 12:38:06 AM »
This is the status so far: with a custom control from "on_signal" I can find the latest screenshot in the AM folder, launch another screenshot, then I let the ticks routine find the newly created screenshot and load it into a surface with shaders.

Sadly I can't seem to make it work with overlay display calls :(