Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFL is compatible with old devices on WeChat IOS, which can cause__scissorRectangle An error occurred during off screen rendering; #2675

Open
rainyt opened this issue Nov 9, 2023 · 0 comments

Comments

@rainyt
Copy link
Contributor

rainyt commented Nov 9, 2023

Describe the bug
When I use Bitmap's scrollRect API, when the object is not rendered on screen, scrollRect will fail and display a complete BitmapData screen.

To Reproduce

var bitmap = new Bitmap(Assets.getBitmapData("assets/1024.png");
bitmap.scrollRect = new Rectangle(300,300,50,50);
this.addChild(bitmap);
// out screen
bitmap.x = stage.stageWidth;

Expected behavior
It should not be presented off the screen, so is there a way to determine when the scissorRectangle is no longer in the picture, it will not be rendered?

I made a simple patch for this, but I don't think it's the best solution because it still uploads vertex data:
zygameui/openfl@0a981d8#diff-e10e3ae597de950c45f6be87b465cf143300102fbd1ede24aae0a3301ba25aae

Screenshots
Everything was rendering normally on the screen, but in the end, I moved it off the screen and it became invalid. Generally, this is caused by third-party custom Context3D behavior, which works fine on most devices. However, processing without rendering off screen should also be compatible, which can improve performance.
In screen:
image
Move to out:
image
Boom:
image

OpenFL Targets
HTML5, and Wechat Mini Game.

Additional context
None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant