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

Feature Request: CacheAsBitmap for V8 #10504

Open
farscapex opened this issue May 2, 2024 · 3 comments
Open

Feature Request: CacheAsBitmap for V8 #10504

farscapex opened this issue May 2, 2024 · 3 comments
Assignees
Labels
🙏 Feature Request Community request for new features, APIs, packages.

Comments

@farscapex
Copy link

Current Behavior

I noticed that cacheAsBitmap property from Container class has disappeared.
Is there a workaround for that ? Or maybe a come back of the property ?
This feature was really powerful in the previous versions and many projects cannot be migrated without that.

Expected Behavior

When we have a container and many sprites side by side, with V7 and cacheAsBitmap enabled, we can scale the container as much as we want, the container behave like an image and displays no spaces between the sprites.

v7

Steps to Reproduce

in V8 without cacheAsBitmap, when the container is rescaled, some spaces appear between the sprites and do not behave like an image which results in some weird behaviour (see attached images)

v8

Environment

  • pixi.js version: e.g. 8.1.0
  • Browser & Version: e.g. Chrome

Possible Solution

I can export the container as a texture and make a simple workaround like that:

let options = { target:myContainer }
let texture = app.renderer.extract.texture(options);

but when the container exceed the texture size limit, this workaround cannot work and besides, it adds a new texture to the memory etc, which was well handled in V7 and all previous versions of Pixi...

Additional Information

Thanks a lot !

@Makio64
Copy link

Makio64 commented May 3, 2024

In v8 I didnt got this problem with adding 1px padding on my sprite in my spritesheet.

Also in my experience this kind of problem can be also be linked with the generation of the mipmap if the sprite is used to a smaller version of himself, then it will use the generatemipmaps and this typically result in bad behaviors with line appearing on the border like the one you screenshot.

@farscapex
Copy link
Author

This workaround works in some cases yeah, but it does not come with the cacheAsBitmap functionalities, such as blocking all animations or updates within any cached container.

the cacheAsBitmap property was very useful in previous versions, does the team schedule to implement that again in V8 or it is just erased like that with no migration options ?

Thank you^^

@GoodBoyDigital GoodBoyDigital self-assigned this May 20, 2024
@Zyie Zyie added the 🙏 Feature Request Community request for new features, APIs, packages. label May 23, 2024
@Zyie
Copy link
Member

Zyie commented May 23, 2024

Hey @farscapex we are planning on adding this bac fairly soon

@Zyie Zyie changed the title Bug: CacheAsBitmap removed from V8 ? Feature Request: CacheAsBitmap for V8 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 Feature Request Community request for new features, APIs, packages.
Projects
None yet
Development

No branches or pull requests

4 participants