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

All children of a Container should have scroll factor 0 #4475

Closed
enriqueto opened this issue Apr 17, 2019 · 4 comments
Closed

All children of a Container should have scroll factor 0 #4475

enriqueto opened this issue Apr 17, 2019 · 4 comments

Comments

@enriqueto
Copy link

When using a container it should be enough to set scroll factor 0 for all its children to remain fix to the camera.

Now I need to do child.setScrollFactor(0) for every child.

@photonstorm
Copy link
Collaborator

photonstorm commented Apr 17, 2019

This brings up an interesting dilemma though. Should a Container scrollFactor override whatever the child has set? Or be added to it? (in the same way alpha, scale, etc does), especially as Containers don't have to be an exclusive parent.

@enriqueto
Copy link
Author

Override would work for me. I basically use Containers for game menus.

@photonstorm
Copy link
Collaborator

I guarantee this is a 50/50 thing. What works for you will annoy the other 50% who'd expect scrollFactors to be combined, rather than replaced.

@photonstorm
Copy link
Collaborator

The Container.setScrollFactor method now has an optional argument updateChildren which can be used to do this directly.

photonstorm added a commit that referenced this issue Apr 24, 2019
…pdateChildren`. If set, it will change the `scrollFactor` values of all the Container children as well as the Container. Fix #4466 #4475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants