altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

alt.takeScreenshotGameOnly() sometimes captures webview

Open Hardy535 opened this issue 3 years ago • 1 comments

Description of the problem

alt.takeScreenshotGameOnly() sometimes also captures the webview even though it's not supposed to.

Reproduction steps

This can best be reproduced if calling the function frequently with a very short delay inbetween, some screenshots will have the webview captured.

Expected behaviour

Shouldn't capture the webview

Additional context

No response

Operating system

Windows 11 (21H2)

Version

alt:V build #12.10, branch release

Hardy535 avatar Aug 25 '22 20:08 Hardy535

Confirmed on 13.0-dev12

Sometimes can reproduce with steps:

let webview = new alt.WebView("https://google.com");
webview.size = new alt.Vector2(500,500);

for (let i = 0; i < 100; i++)
{
    await alt.takeScreenshotGameOnly();
    if (i == 16) {
        console.log(await alt.takeScreenshotGameOnly());
        return;
    }
}

https://gist.githubusercontent.com/cbmgit/40c1348f6f291db84e59cd06544ba0e1/raw/base64toimage.txt

litolax avatar Aug 25 '22 20:08 litolax

@litolax @Hardy535 is this still a thing?

C0kkie avatar Apr 16 '23 09:04 C0kkie

Reproduced

litolax avatar Apr 16 '23 11:04 litolax

Reproduced

Try capping your fps to for example 120 or 100 and the issue should be most likely gone.

There seems to be a bug when you have high fps it shows your webviews and overlays.

omuc avatar Jun 07 '23 07:06 omuc