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

Is there a way to modify the project to be able to use APNG or GIF as images? #7

Open
nomehagasmuchocaso opened this issue Nov 5, 2023 · 2 comments

Comments

@nomehagasmuchocaso
Copy link

I'm developing a small choose-your-own-adventure example to learn how to use qx82 and the only way I've gotten animated images is by using 90 to 100 separate frames for a simple background animation using qx.frame.

Is there a way to load animated images that are not JPG or PNG?

@btco
Copy link
Owner

btco commented Nov 5, 2023

Ah! For now only JPG and PNG are supported, but there is qx.drawImageRect() that allows you to draw a part of an image (you can see it in action in example-puzzle).

So in theory you could lay out your animation frames side by side in a single image like a sprite sheet, and then cycle through them using qx.frame(), drawing a different rectangle each time. That will be a lot faster than loading 100 separate images.

But I'll look into supporting animations in a more straightforward way in the future. I'd love to see your choose-your-own-adventure game when it's ready!

Thanks!

@nomehagasmuchocaso
Copy link
Author

Thank you very much for the response, I will investigate the puzzle example and will be on the lookout for future updates.

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

No branches or pull requests

2 participants