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

Canvas layers or the art of multi-canvas #70

Open
Incubatio opened this issue Feb 17, 2013 · 0 comments
Open

Canvas layers or the art of multi-canvas #70

Incubatio opened this issue Feb 17, 2013 · 0 comments

Comments

@Incubatio
Copy link

We talked a bit about it on irc a month ago,
to recall the main lines:

At some point you can have an advanced game that require lots of resource because of heavy graphics many layered elements.Having multiple layer element and implementing dirty redrawing can be very time consuming and require a complex architecture (not easy to maintain).

I actually experienced it when I wrote a rpg where I used a particule engine to generate blood explosion where blood stayed after explosion uppon the background but behind the main character.
To fix my problem I had to sacrifice my lazy redrawing and spend several days changing my game logic.
With multiple canvas I could have move background to a another canvas, and apply those blood explosion on the background canvas.

This technique also spare performance because if you have a fancy background it will not repaint it on every frame (at least not by js)

Note that we can simply keep single canvas by default, and people who would do advanced game could use this feature just by updating simply option in a constructor.

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

1 participant