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

Constrain the size of the canvas from scene parameters #924

Open
dsmtE opened this issue Jan 21, 2024 · 0 comments
Open

Constrain the size of the canvas from scene parameters #924

dsmtE opened this issue Jan 21, 2024 · 0 comments
Assignees
Labels
b-enhancement New feature or request

Comments

@dsmtE
Copy link

dsmtE commented Jan 21, 2024

I'd like to be able to set the height of the final canvas (displayed with AnimationPlayer) from my scene parameters.

Currently, I change the height of the view based on several variables (view.height(squareSize + 2 * margin + 2 * jump);) but the size of the final canvas doesn't change and makes a transparent and unwanted padding.

It seems that this is controlled by the project size and by updating the meta-file (size property) it works.

But I want to control this height according to my variables and not hard-code the canvas size.

The advantage of this is to have a more flexible way of changing the size of the rendering canvas when using the AnimationPlayer integrated into a website (I'm on Docusaurus).

One possible solution would be to have another method similar to makeScene2D but which could return the desired canvas size.
If it's really project-related and it's not possible to change this, one possibility would be to be able to create a project that contains only one scene and have custom settings and access to the canvas size in this particular case.

Image of unwanted transparent padding on the final canvas :
image

@dsmtE dsmtE added the b-enhancement New feature or request label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b-enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants