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

Add clearCanvas option #20

Merged
merged 1 commit into from
Jul 27, 2024
Merged

Add clearCanvas option #20

merged 1 commit into from
Jul 27, 2024

Conversation

lukix
Copy link
Owner

@lukix lukix commented Jul 27, 2024

This can be useful when wanting to combine view from 2 cameras on one canvas. For example one for rendering game objects and one for rendering UI elements.

draw({
  context,
  objects: gameObjects,
  camera, // dynamic game camera (for example following character)
});

draw({
  context,
  objects: uiObjects,
  clearCanvas: false, // we want to overlay UI on top of previously rendered game objects
  // using default static camera to position UI elements independently from game camera
});

@lukix lukix merged commit 9d41c8d into master Jul 27, 2024
1 check passed
@lukix lukix deleted the add-option-to-skip-clearing-canvas branch July 27, 2024 15:40
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

Successfully merging this pull request may close these issues.

1 participant